[SDL] He don't want [event]

elekis elekis at gawab.com
Fri Feb 4 05:05:12 PST 2005


hi,
I have two probs first is whit event . just this little prog


#include <iostream>
#include <SDL/SDL.h>
using namespace std;
SDL_Surface* ECRAN;
const int LARG = 300;
const int LONG = 300;


int main(int argc, char* argv[])
{
    SDL_Init(SDL_INIT_EVERYTHING);   
        atexit(SDL_Quit);
    SDL_Rect rec; rec.x = 0; rec.y =0; rec.w=LARG; rec.h = LONG;   
    ECRAN = SDL_SetVideoMode(LARG,LONG,0,SDL_ANYFORMAT);
    SDL_FillRect(ECRAN, &rec, 0x12345678);
    SDL_Flip(ECRAN);
    SDL_Event event;
    while(1)
    {
        SDL_WaitEvent(&event);
        if(event.type == SDL_QUIT){cout << "quit prog"<< endl;return 0;}
        if(event.type == SDLK_F1) cout << "tape F1" << endl;
        if(event.type == SDLK_BACKSPACE) cout << "tape BACKSPACE" << endl;
        }   

    }



the SDL_QUIT work perfecly, but nothing arrive for the other . I even 
have that msg when I compil

main.cc:22: warning: comparaison is always false due to limited range of 
data

line 22 is  if(event.type == SDLK_F1) cout << "tape F1" << endl;

is there a error in my code??

thanks.

a++




More information about the SDL mailing list