Jump to content
  • Advertisement
Sign in to follow this  
Bearhugger

OpenGL Issues with OpenGL and Aero on Windows 7

This topic is 3075 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

I'm not sure if it is OpenGL or SDL that is the problem, so sorry if this is not the right board. Anyway, I have a small (but annoying) issue with my OpenGL game. Whenever I run my game in full-screen, Aero dies and I lose the transparency effect of every window, the small window previews when I hover the mouse cursor over a window's button in the task bar, and other similar desktop features of Windows 7. (Same effect as when I unplug my laptop and the system goes to battery saving mode.) I did some searchs on Google and I discovered that some graphic card drivers disable Aero when a OpenGL application goes full-screen in order to preserve performance. This is totally fine, except that Aero is never re-enabled, and the only way I have found to restore it is to reboot my system. I've run other applications that use OpenGL to make sure that it is not my game, and the same thing happens. These problems began occuring recently, so I suppose it is a driver update that caused this... but I could be wrong. Does anyone have a solution to fix this? Or should I just port the game to DirectX and get over with this sloppy OpenGL support?

Share this post


Link to post
Share on other sites
Advertisement
OpenGL isn't sloopy. I had the same Issue with Win7 Beta. I am using SDL with OpenGL too. Having Win7 Ultimate now, solved the issue for me. What version are u running?

This is how I initialize OpenGL:

#define NIGHTLIGHT_SDL_VIDEO_FLAG SDL_OPENGL
//-----------------------------------------------

// Start SDL
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER ) == -1)
{
NLTrace("Cannot initialize SDL!");
throw NLException("Cannot initialize SDL!", true);
}

// Prepare Flags for SDL
long flags = NIGHTLIGHT_SDL_VIDEO_FLAG;
if (m_settings.fullscreen)
{
flags |= SDL_FULLSCREEN;
}

// OpenGL-Flags
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);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, m_settings.bpp);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, m_settings.fsaa);

// Create Window
m_window = SDL_SetVideoMode(m_settings.width, m_settings.height, m_settings.bpp, flags);
if (m_window == NULL)
{
NLTrace("Cannot create SDL-Window!");
throw NLException("Cannot create SDL-Window!", true);
}

// Choose perspective
if (m_settings.mode == NightLight::OpenGL2D)
{
this->initGL2D(m_settings.width, m_settings.height);
NLTrace("Ortho-View chosen by NLWindow().");
}
if (m_settings.mode == NightLight::OpenGL)
{
this->initGL(m_settings.width, m_settings.height);
NLTrace("Perspective-View chosen by NLWindow().");
}

// Init Glew
glewInit();

// Dump infos about renderDevice to the log.
this->dumpInfos();

// Bring mouse to the middle of the screen.
SDL_WarpMouse(m_settings.width / 2, m_settings.height / 2);

// Set Caption
SDL_WM_SetCaption(m_settings.caption.c_str(), NULL);

HTH
regards

Share this post


Link to post
Share on other sites
I use and create games with OpenGL and Windows 7 x64 and have yet to encouter any problems like you describe. If SDL handles the windows I would probably say its something your doing wrong with SDL.

Share this post


Link to post
Share on other sites
I had similar issues that were fixed with different drivers. In one case I was just left with a transparent rectangle where the opengl context should be when rendering with aero turned on, and it worked fine when rendering in the windows classic theme.

Share this post


Link to post
Share on other sites
Thanks for the answers.

I don't think it is my code that has a problem because running World of Warcraft with the OpenGL flag gives me the same effect, and ditto with ZSNES.

My version of Windows 7 is Family Premium Edition. I've tried updating my driver and the OS but everything is up-to-date. If it matters, the problems I describe occur on a recent laptop with a GeForce GT 220M video card.

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!