SDL and mouse
HI everyone, i have 1 question about SDL and mouse:
i created a simple sdl program (which displays some images from jpg files) , it works without any problem in X, in console without X it works still without problems BUT only when i'm running it like ROOT. When i try to run it with simple user, i cet the error : SDL unable to initialize the mouse. NOw i dont need mouse support in it, can i disable mouse somehow ? here is the part of code: SDL_Surface *init_video() { SDL_Surface *screen; /* Initialize SDL's video system and check for errors */ if (SDL_Init(SDL_INIT_VIDEO) != 0) { printf("Unable to initialize SDL: %s\n", SDL_GetError()); return NULL; } /* Make sure SDL_Quit gets called when the program exits! */ atexit(SDL_Quit); /* Attempt to set a 640x480 hicolor video mode */ screen = SDL_SetVideoMode(640,480, 16, SDL_FULLSCREEN); if (screen == NULL) { printf("Unable to set video mode: %s\n", SDL_GetError()); return NULL; } return screen; } |
Set this environment variable:
Code:
export SDL_NOMOUSE=1 |
ok thx mate it woked.
|
All times are GMT -5. The time now is 04:33 AM. |