tags:

views:

239

answers:

1

I am creating a series of scrolling windows, created by openGL. This code is legacy code and able to do this successfully. Then I want to add text to these scrolling lists, which I do through a drawing callback function. When the scrolling list appears in the window, the draw callback prints the text into the list. This normally works. However as I scroll to the 7th list it stops printing the text. I am able to select it, but it won't print the text. Here is the code I use for printing text to a scrolling list window:

void PrintString(const char *str, int ListBase) { glPushAttrib(GL_LIST_BIT) glListBase(ListBase) glCallLists(strlen(str), GL_UNSIGNED_BYTE, str) glPopAttrib() }

As I scroll through each list, I am calling this multiple times. It reaches this function and prints the text for the first six scrolling list. When it reaches the 7th it stops printing the text. I have spent hours on this problem and I have come to the conclusion that it is OpenGL and printing text. Please help. How do you print text in openGL, my fonts are already defined? Why would it not print it?

+1  A: 

If you just want to debug this with minimal code changes, you should have a look at gDEBugger. It's basically the only way to remain sane when investigating such things.

If you consider rewriting your text renderer, you should consider drawing small blocks into offscreen buffers (using Cairo, Anti-Grain or the Windows API), upload them as texture and draw these. This should improve both rendering quality (proper kerning etc.) and speed, and additionally you only have to use easier to debug OpenGL calls.

Malte Clasen