Jump to content

  • Log In with Google      Sign In   
  • Create Account

A couple problems with my SDL/OpenGL project


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Flustration   Members   -  Reputation: 101

Like
0Likes
Like

Posted 09 May 2012 - 06:19 PM

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, 10 May 2012 - 07:23 PM.


Sponsor:

#2 DemonRad   Members   -  Reputation: 290

Like
0Likes
Like

Posted 10 May 2012 - 01:28 AM

maybe your resolution is not supported? try using a different resolution like 800,600.

Peace and love, now I understand really what it means! Guardian Angels exist! Thanks!


#3 Flustration   Members   -  Reputation: 101

Like
0Likes
Like

Posted 10 May 2012 - 01:33 AM

Well, the app initiates at the appropriate resolution and everything... I just lose input.

#4 AlanSmithee   Members   -  Reputation: 1061

Like
0Likes
Like

Posted 10 May 2012 - 06:19 AM

Hello!

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, 10 May 2012 - 07:11 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS