Advertisement

Relationship between client rectangles and glTranslate floats

Started by May 22, 2003 09:59 AM
2 comments, last by echleon 21 years, 9 months ago
hey, I am just trying to plot a complex line graph in openGl and am wondering is there any relationship between a client rectangle and a GLTranslate? I have set the viewport to the client rectangle, can I start drawing from the side of the screen? What I draw does not show so obviously is not in the viewport. I hope this makes sense as I am only new to actually writing gl code. cheers, Ech
If you are ploting graph then I guess you are using Ortho mode. Before you translate anything (0, 0) is in bottom left corner of the viewport. So everything starts in that corner...
Advertisement
Yep you''re right, you need to set up your view port using the client area dimensions, and not the usual window frame dimensions. Unless you tinker with the parameters, you should also realize (as the previous poster mentioned) that the origin (0,0) will be located at the bottom left corner of the window''s client area.
Okay, so after I set the viewport, using,

GetClientRect(hWnd,▭);
glViewport(0,0,rect.right,rect.bottom);

what do I need to set so I can use GL_LINE_STRIP from the origin?

A pointer to something on why I am doing it would prolly be better than simply telling me :-)

cheers

ech.

This topic is closed to new replies.

Advertisement