Jump to content
  • Advertisement
Sign in to follow this  

A couple problems with my SDL/OpenGL project

This topic is 2356 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! My SDL OpenGL application is based on SDL. For some reason, I receive input fine via the SDL_Event unless I add the SDL_Fullscreen flag. In full screen mode, I get no input events at all, strangely.

//Start SDL,

if( SDL_Init( SDL_INIT_EVERYTHING ) != 0 )
printf("SDL failed to initialize: %s\n", SDL_GetError());
return 1;

//Set up screen

SDL_Surface* screen;

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);

if((screen = SDL_SetVideoMode( 900, 600, 32, SDL_OPENGL | SDL_FULLSCREEN)) == NULL)
printf("Error creating SDL surface: %s\n", SDL_GetError());

Thanks much! Edited by Flustration

Share this post

Link to post
Share on other sites

I don't have a solution for you, the code you provided doesn't really give any indications either.
If the problem was related to setting up the screen, chanses are the application would crash or atleast the rendering would be acting in a non-predictive way.

There are some very subtle and wierd behaviour that can occour though that are hard to trace. Once when I changed my BPP from 32 to 16 my application would crash and it turned out that the actual cause was that I was using frame capping and with 16 BPP the frame-time was so low that it caused negative values which resulted in a crash. Not saying this is what is happening to you, but it might be something that is hard to see by just looking at your code and changed you make can affect things that seem to be unrelated.

My suggestion is using breakpoints and watches and debug your application, should be fairly easy to find the bug if you do.
If you still can't find it I think we would need more code to be of help!

BR / AS. Edited by AlanSmithee

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!