issue with undocumented gl_qwh

1 view
Skip to first unread message

Raul Miller

unread,
10:57 AM (1 hour ago) 10:57 AM
to J Programming Forum
I am trying to understand the nature of the undocumented gl_qwh
instruction which I see used in the Help > Studio > Qt Demos... shader
source.

In that demo, it is being used to determine the aspect ratio of the screen.

Intuitively, from the name (and usage), I would imagine that it
provides the width and height of the current drawing surface.

However, if I use this width and height as the width and height in the
argument to glViewport, I find that it's not quite the full drawing
surface (there are some pixels in the top of the drawing region and
the right hand side of the drawing region which are not used to
display the image. (These wind up being "beyond" largest supported
coordinates on the window's x and y axis, which in opengl ranges from
_1 to 1)).

Also, looking at qtide implementation (which seems to be spread out
over lib/wd/gl2.h, lib/wd/gl2class.h, lib/wd/ogl2.h and
lib/wd/wd.cpp), I am baffled by some of the complexity - I am not sure
why it's written the way it is (which limits my ability to contribute
usefully on this topic).

Since knowing the screen dimensions of the drawing surface seems like
a useful bit of information, is there some other approach I should be
using to make that query?

Should I (or we) be asking additional questions about the qtopengl API?

Thanks,

--
Raul
Reply all
Reply to author
Forward
0 new messages