This is from the wxWidgets 3.0 manual.
-----------------------------------------
Detailed Description
wxGLCanvas is a class for displaying OpenGL graphics.
It is always used in conjunction with wxGLContext as the context can
only be made current (i.e. active for the OpenGL commands) when it is
associated to a wxGLCanvas.
More precisely, you first need to create a wxGLCanvas window and then
create an instance of a wxGLContext that is initialized with this
wxGLCanvas and then later use either SetCurrent() with the instance of
the wxGLContext or wxGLContext::SetCurrent() with the instance of the
wxGLCanvas (which might be not the same as was used for the creation of
the context) to bind the OpenGL state that is represented by the
rendering context to the canvas, and then finally call SwapBuffers() to
swap the buffers of the OpenGL canvas and thus show your current output.
Notice that versions of wxWidgets previous to 2.9 used to implicitly
create a wxGLContext inside wxGLCanvas itself. This is still supported
in the current version but is deprecated now and will be removed in the
future, please update your code to create the rendering contexts explicitly.
To set up the attributes for the canvas (number of bits for the depth
buffer, number of bits for the stencil buffer and so on) you should set
up the correct values of the attribList parameter. The values that
should be set up and their meanings will be described below.
Note:
On those platforms which use a configure script (e.g. Linux and Mac
OS) OpenGL support is automatically enabled if the relative headers and
libraries are found. To switch it on under the other platforms (e.g.
Windows), you need to edit the setup.h file and set wxUSE_GLCANVAS to 1
and then also pass USE_OPENGL=1 to the make utility. You may also need
to add opengl32.lib and glu32.lib to the list of the libraries your
program is linked with.
-------------------------------------
Also the wxGLCanvas constructor has changed to also support OpenGL
attributes.
Rizzen
Charles Cossé wrote:
> Is there some important change in wx 2.9 which is very different from
> wx 2.8 ? (and if yes, what?)
> Charles
>
> On Wed, Feb 17, 2010 at 5:03 PM, Rizzen <[email protected]
> <mailto:[email protected]>> wrote:
>
> Well thanx to you for response, though was not for wxWidgets
> 2.9.1, but
> for wxWidgets 2.8.x
>
> After spending the day on working through the 3 wxWidgets examples, I
> managed to figure out how to make the changes to osgviewerWX to get it
> to work with the new wxGLCanvas (and wxGLContext) for 2.9.0+.
>
> Included the 2 files that was changed for others to test it too.
>
> Rizzen
>
> Charles Cossé wrote:
> > I have some wx-osg code on my website that might help ... it's under
> > project "G4OSG" @ www.asymptopia.org <http://www.asymptopia.org>
> <http://www.asymptopia.org> ...
> >
> > On Tue, Feb 16, 2010 at 4:04 PM, Rizzen <[email protected]
> <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]>>>
> wrote:
> >
> > Hi,
> >
> > I really need up with making osgviewerWX work with up coming 3.0
> > release
> > (currently 2.9.1) in first half of 2010.
> >
> > I am completely confused on where to create the required
> > wxGLContext in
> > the osgviewerWX source. I looked at the 3 wxWidgets OpenGL
> > samples, yet
> > I am still very confused. Each one seems to do the
> implementation
> > differently, thus don't know which implementation is best for
> > osgviewerWX.
> >
> > I appreciate any help in getting osgviewerWX to work with
> > wxWidgets 2.9.1.
> >
> > Thanx in advance
> > Rizzen
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> <mailto:[email protected]>
> > <mailto:[email protected]
> <mailto:[email protected]>>
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> >
> >
> > --
> > AsymptopiaSoftware|softw...@thelimit
> > http://www.asymptopia.org
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> <mailto:[email protected]>
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> <mailto:[email protected]>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
>
> --
> AsymptopiaSoftware|softw...@thelimit
> http://www.asymptopia.org
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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