LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 11-08-2005, 03:31 PM   #1
myrmidon
Member
 
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! */
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;



}
 
Old 11-10-2005, 01:51 AM   #2
mic
Member
 
Registered: Jun 2005
Posts: 44

Rep: Reputation: 16
Set this environment variable:
Code:
export SDL_NOMOUSE=1
I too had hard time figuring that out
 
Old 11-11-2005, 10:33 AM   #3
myrmidon
Member
 
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.
 
  


Reply


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/Novell 0 11-26-2005 07: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 07:50 AM
about SDL dt_ashok Programming 1 12-01-2004 03:16 PM
Sdl timcrafton Linux - Games 8 10-13-2004 01:11 PM
Sdl? tundra Linux - General 5 05-03-2003 08:17 AM


All times are GMT -5. The time now is 02:15 AM.

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