|
QCPlugInContext get bounds in pixel dimensionsHi, I'm trying to get the QC context dimensions in pixels. So far [context bounds] returns values in QCunits. That's not so convenient to me as I'm trying to set a FBO according to QC viewport size in pixel. Is there an elegant way to retrieve these values ? Note that I can still publish some inputs from within my patch and hook then to a Rendering Destination Dimensions patch, but that's rather a cowboy way of doing things... Regards.
|
glGetIntegerv(GL_VIEWPORT, viewport); where viewport is a GLint *
make that a GLint[4] (don't want to smash the stack there).
this isn't quite reliable - it's entirely possible for a patch to make the viewport a subset of the available context (there's a GLTools patch that does that, for example). that may or may not be a deal breaker, but it's something to be aware of.
thanks for the fast reply !
good question franz. kind of difficult to convert your units to pixels without knowing the viewer size.