Discussion:
glGetIntegerv(GL_VIEWPORT, @ vpdim[0]) returns wrong size.
(too old to reply)
chris jones
2003-06-23 16:00:56 UTC
Permalink
Hi, i am doing this to set top down ortho orientation....

wglMakeCurrent(dc, glcontext);
glGetIntegerv(GL_VIEWPORT, @ vpdim[0]);
width := vpdim[2];
height := vpdim[3];
glOrtho(0, width, height, 0, -1, 1);

which works fine until the window is resized, i have traced the problem to
glGetIntegerv. It always returns the initial size of the viewport even
though it has changed, glClear clears the new sized window ok but no my
origin is not where i want it.

What am i doing wrong?

thanks again,

chris
bunny
2003-06-23 16:43:53 UTC
Permalink
Post by chris jones
Hi, i am doing this to set top down ortho orientation....
wglMakeCurrent(dc, glcontext);
width := vpdim[2];
height := vpdim[3];
glOrtho(0, width, height, 0, -1, 1);
which works fine until the window is resized, i have traced the problem to
glGetIntegerv. It always returns the initial size of the viewport even
though it has changed, glClear clears the new sized window ok but no my
origin is not where i want it.
What am i doing wrong?
Have you used glViewport to specify the new viewport in response to the
window resize? OpenGL doesnt track it automatically.
chris jones
2003-06-23 17:54:00 UTC
Permalink
Post by bunny
Post by chris jones
Hi, i am doing this to set top down ortho orientation....
wglMakeCurrent(dc, glcontext);
width := vpdim[2];
height := vpdim[3];
glOrtho(0, width, height, 0, -1, 1);
which works fine until the window is resized, i have traced the problem to
glGetIntegerv. It always returns the initial size of the viewport even
though it has changed, glClear clears the new sized window ok but no my
origin is not where i want it.
What am i doing wrong?
Have you used glViewport to specify the new viewport in response to the
window resize? OpenGL doesnt track it automatically.
yes i tried that but it made no diferance,

However openGl still clears the whole resized window even if i dont put the
setViewport in, which confuses me.

thanks,

chris

fungus
2003-06-23 17:47:41 UTC
Permalink
Post by chris jones
Hi, i am doing this to set top down ortho orientation....
wglMakeCurrent(dc, glcontext);
width := vpdim[2];
height := vpdim[3];
glOrtho(0, width, height, 0, -1, 1);
which works fine until the window is resized, i have traced the problem to
glGetIntegerv. It always returns the initial size of the viewport even
though it has changed, glClear clears the new sized window ok but no my
origin is not where i want it.
What am i doing wrong?
glget(GL_VIEWPORT) only returns the values you
passed to glViewport(). It has no relation to
the window.
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
Loading...