Skip to main content
GameDev.net gamedev.net
🔒 Locked

Fullscreen Opengl

Started by Monki Sep 26, 2002 at 1:52 AM 9 replies 550+ views
Original Post
Monki
Monki
I''m trying to set up an application with support for fullscreen opengl. My understanding is that this is accompilished with:
  
	// Setup fullscreen

	DEVMODE devModeScreen;								// Device mode

	memset(&devModeScreen,0,sizeof(devModeScreen));	// Clear mode

	devModeScreen.dmSize=sizeof(devModeScreen);		// Size of structure

	devModeScreen.dmPelsWidth	= Instance->width;				// Selected width

	devModeScreen.dmPelsHeight	= Instance->height;				// Selected height

	devModeScreen.dmBitsPerPel	= Instance->bits;					// Selected bits per pixel

	devModeScreen.dmFields= DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
	ChangeDisplaySettings(&devModeScreen,CDS_FULLSCREEN)	
  
But thats where the problem comes in. On several other opengl example programs that I have compiled and run fullscreen works fine. But when I try to use it in my app, as specified above, it will NOT work. Are there some other project settings or something that I''m overlooking, or an include? Any input would be very appreciated. Thanks...
Brian Jones
Brian Jones
Maybe the mode you''re trying to use isn''t supported by your graphics card
I don't have a signature
Brian Jones
Brian Jones
Also, always do error checking

// Assume displaysettings is already set
long error;

if((error = ChangeDisplaySettings(&displaysettings, CDS_FULLSCREEN)) != DISP_CHANGE_SUCCESSFUL)
{
// Do something
}

[edited by - Brian Jones on September 26, 2002 3:03:05 AM]

[edited by - Brian Jones on September 26, 2002 3:05:05 AM]
I don't have a signature
Monki
Monki
Thanks for the input guys. First off I thought that it might just be my video card not supporting it. But when I took some other example programs and recompiled and ran them on my machine they used more or less the same chunk of code to do fullscreen. And they worked. But for some reason when I make similar changes to my program I get an error about my graphics card not supporting that mode. Which would be fine, but why the double standard? Also, as for the error checking, its there in the actual code. I just took it out for the post, so that that it would be as straightforward as possible to convey the actual problem at hand. Thanks for the input though. Seems like a strange error. I guess I''ll have to try my program on a couple other computers too and see if it is just a graphics card issue. I am just a bit doubtful about that since other programs running what appears to be the same type of setup work just fine. Anyway, if there are any more ideas I''m all ears. Thanks again you guys.....
Monki
Monki
As a bit of an update. I finally got around to trying my program on a friends computer and it worked as advertised. So the code in my program really must not be at fault. Or at least not for the most part. There is the issue of other programs using very similar code(most demos based of of nehegl source) that setup fullscreen the same way and WORK on my computer. If nothing else I guess I can just keep programming on my comp and check output on another, but thats a real pain. If anybody has any idea what the descrepancy might be caused by I''d love to hear it...
areeves
areeves
I''m having a similar bother actually. I haven''t even gotten my computer configured to write OpenGL programs, but I can''t view the example programs correctly. It works fine in windowed mode, but when I switch to full screen ( in those simple tirangle and square demos) the Red channel seems to be gone. My computer is on the verge of being replaced anyway, but I haven''t had any problems with the video card in the past (who knows what it is). Yesterday was my first day in OpenGL and just in examining the tutorials I had some trouble :-) DirectX gave me a headache so I still want to use OpenGL
Mihail121
Mihail121
The answer is more than simple.DO YOU CLEAR THE STRUCT WITH MEMSET.There is not telling what results may occur if the struct is not absolutely clear!!!


The pain is coming...this sommer!!!
Monki
Monki
Brian Jones - I am clearing it in the second line. Not sure if you realized this or not, though it looks like you might have in your second post.
Thanks for the added input. It may well be just a hardware error. It''s not a real huge deal since I''m in the process of building a new computer anyway and that in itself will likely deal with the problem.
The thing is that for now at least this is a terrible nuisance. I can code on this machine, but if I want to see the actual input I have to transfer the exe. If this was simply due to some lack of hardware on my part I would understand.
But the example programs from nehe DO work in fullscreen. No errors, goes to fullscreen, looks fine. But when I use what is more or less the same few lines of code to do the same thing it fails.
That is where I''m stuck...
cdtrrrst
cdtrrrst
win32 code poisoning...
People are not inherently evil, but all of them are guillty of something...
Prosper/LOADED
Prosper/LOADED
How many bits per pixel are you trying to set ? Some video cards support 24 bpp and others don''t so this may be your problem. 16 and 32 bits bpp are more widely accepted.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.