Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-08-2005, 04:31 PM   #1
Registered: May 2005
Distribution: redhat 9 , fedora 5,6,7,DSL,Debian 3, mandrake 9.2 , knoppix 3.8, red hat 7.3
Posts: 38

Rep: Reputation: 15
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! */

/* 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;

Old 11-10-2005, 02:51 AM   #2
Registered: Jun 2005
Posts: 44

Rep: Reputation: 16
Set this environment variable:
export SDL_NOMOUSE=1
I too had hard time figuring that out
Old 11-11-2005, 11:33 AM   #3
Registered: May 2005
Distribution: redhat 9 , fedora 5,6,7,DSL,Debian 3, mandrake 9.2 , knoppix 3.8, red hat 7.3
Posts: 38

Original Poster
Rep: Reputation: 15
ok thx mate it woked.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sdl style apps mouse jumps every 5sec (fluxbox tested) netsurf SUSE / openSUSE 0 11-26-2005 08:27 PM
Trying to program an SDL application but cannot find the SDL.h file:SuSE 9.2&KDevelop pujolasdf Linux - Newbie 4 03-13-2005 08:50 AM
about SDL dt_ashok Programming 1 12-01-2004 04:16 PM
Sdl timcrafton Linux - Games 8 10-13-2004 02:11 PM
Sdl? tundra Linux - General 5 05-03-2003 09:17 AM

All times are GMT -5. The time now is 08:10 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration