Jump to content
  • Advertisement
Sign in to follow this  
Adawyn

OpenGL win32 alert for maximize

This topic is 5071 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 am writing a tool based application using opengl for rendering. In my windows proc for the main window I would like to detect all messages for repainting, and I can't seem to find the message that indicates that a window has been maximized. I have used the WM_PAINT and WM_ACTIVATE which ones am I missing?

Share this post


Link to post
Share on other sites
Advertisement
adding wm_size makes it flicker before clearing to nothing... there must be some other message that is clearing it...

Share this post


Link to post
Share on other sites
You're gonna want to make sure that you have a resize function after calling WM_SIZE... like this for example:


case WM_SIZE:
{
ResizeMainWindow();
RenderMainWindow();
break;
}

Share this post


Link to post
Share on other sites
well I was calling my render function and then calling DefWindowProc(...) to make sure all the drawing of windows is still taken care of

Share this post


Link to post
Share on other sites
You have to make sure you set the new viewport, because the viewport gets bigger when you fullscreen.


glViewport(0, 0, width, height); // Reset The Current Viewport

glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity(); // Reset The Projection Matrix

// Calculate The Aspect Ratio Of The Window
gluPerspective(70.0f,(GLfloat)width/(GLfloat)height,10.0f,4000.0f);

glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity();

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!