Hello all!
I’m making a program with graphical chat. In order to do this, I need to
take input from the user (via PollEvent, due to other events happening at
the same time), and display it on the screen. Whenever a key is pressed, the
Unicode is returned as a letter, and the letter printed to the screen.
However, I am having problems with this last part. I can print only 8
letters (one GL_Rect for every new sequence of characters. i.e. ‘A’, then
’AB’, then ‘ABC’, and so on), before a Segmentation Fault occurs, and the
SDL parachute is deployed.
I can’t work out what it could be - the only thing I’ve come up with is that
I’m rendering too fast, but delaying each by 50 milliseconds didn’t work
either.
I’ll post links to the code for the functions that Print the new text to the
screen, and the function that is used within it.
Printing function (called when a new letter is detected):
http://ockmore.pwp.blueyonder.co.uk/PrintChat.htm
Actual function that renders text:
http://ockmore.pwp.blueyonder.co.uk/SDL_GL_Render_Text.htm
Hope you guys can help!
Many Thanks,
-Sputty