LRESULT cApplication::OnSize( WORD wWidth, WORD wHeight )
{
glViewport( 0.0f, 0.0f, (GLsizei)wWidth, (GLsizei)wHeight);
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0.0f, wWidth, wHeight, m_rcClient.top, 1.0f, -1.0f )
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
return 0;
}
Viewport in windowed mode
when I run my app in windowed mode, the point 0,0 is right in the top
left of the window, behind the title bar, rather than at the top left of the
client area. I am assuming it isn''t my drawing code, as when I run in
fullscreen 0,0 is the very top left of the screen. Here is my code that is
called whenever the window is resized, and is also called after I have
inited GL.
I had the same problem, it's very simple to fix. Just put a groupbox in your window that completely covers the client-area. Then retrieve the HDC from the groupbox instead of the window...
It worked for me but i don't know if there are any "cleaner" ways of doing it.....
EDIT: you can use pretty much anything to cover the client-area as long as you can extract the HDC for it.
-Crawl
[edited by - Crawl on May 24, 2002 8:14:09 AM]
It worked for me but i don't know if there are any "cleaner" ways of doing it.....
EDIT: you can use pretty much anything to cover the client-area as long as you can extract the HDC for it.
-Crawl
[edited by - Crawl on May 24, 2002 8:14:09 AM]
--------<a href="http://www.icarusindie.com/rpc>Reverse Pop Culture
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement