Jump to content
  • Advertisement
Sign in to follow this  
ozonozgur

OpenGL GLRecti scaling problem

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

If window’s size change, GLRecti rectlange’s size will scalings of viewport (Rectlange created with glRecti).

How to make constant size GLRecti reclangle in resizable window handle?

And additional images:

Before changing window's size (initialization size):
001paf.png
After changing window's size:

002pie.png
but I want this:

003pu.png
And my project opengl codes:

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0, r.right, r.bottom, 0, -1, 1);
glMatrixMode(GL_MODELVIEW);
// glFrustum(-zoom * 1, zoom * 1, -zoom * 1, zoom * 1,1,-1);
gluPerspective(1, 1, 1, 1);
glEnable(GL_COLOR_LOGIC_OP);
glLogicOp(GL_XOR);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glRecti( 10,10,lright-200,lbottom-200);
glBegin (GL_LINES);
glVertex2i (30,30);
glVertex2i (70,30);
glEnd();
glDisable(GL_COLOR_LOGIC_OP);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
SwapBuffers(DeviceContext);

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!