Frank Sullivan wrote:
Ok, so I haven't yet dealt with this issue in OpenGL. Would it require changing
the rendering context, or possibly deleting it and creating a new one? I'm not
sure, but I guess that is moot because I'm working with OSG and therefore those
details are probably abstracted away to that extent.
No need to create a new context just because the window changed size.
In OpenGL1/2, just specify a new projection matrix with the new aspect
ratio, and set the glViewport to use the new width and height. In OSG,
set the projection matrix and viewport through the Camera class.
For simple examples in pure OpenGL, see the OpeGL Distilled example
code: http://ogld.googlecode.com
So I guess I'm just wondering how I could do this with OSG. In this case, I am
not having OSG launch the window for me. Instead, I have a Panel control in an
already-existing application that I'm using to display the rendered scene. To
do this, I am passing the Panel's HWND to a WindowData object, and then
assigning that object to the inheritedWindowData member of the Traits object
that I use to create the graphics context.
It works fine, but the image seems stretched horizontally, so I'd like to be
able to fix that. Interestingly, I can't seem to 'fix' the stretching by
resizing the Panel, which may be an indication that OSG, or something, is doing
the aforementioned adjustments automatically, but in doing so, maintains the
original aspect ratio, which as I said, results in a stretched image.
Thank you!
Cheers,
Frank
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23080#23080
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org