I want to do something really simple to test it out… so I tried displaying
the key being pressed.
Well, I can’t get it to work… it just crashes.
SDL_Event event;
int quit = 0;
while(!quit)
{
while(SDL_PollEvent(&event))
{
switch(event.type)
{
case SDL_KEYDOWN:
CenteredPutString(screen, 0, SDL_GetKeyName(event.key.keysm.sym);
break;
case SDL_QUIT:
quit = 1;
break;
}
}
}
Doesn’t work… just crashes… any suggestions?_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
Are you sure SDL is being initialized properly?
You’re missing a ) on :
CenteredPutString(screen, 0, SDL_GetKeyName(event.key.keysm.sym);
but I assume that was just in the email… seing as it compiled for you.
I dont use BFont, but the SDL portion of the code is fine as far as I
can see.
-James
Rob R wrote:>
Hey,
Im using BFont to use a PNG font.
I want to do something really simple to test it out… so I tried
displaying the key being pressed.
Well, I can’t get it to work… it just crashes.
SDL_Event event;
int quit = 0;
while(!quit)
{
while(SDL_PollEvent(&event))
{
switch(event.type)
{
case SDL_KEYDOWN:
CenteredPutString(screen, 0,