I've got an opengl application where I manually create an opengl context (I'm able to get an opengl 4.2 context on my machine). I'd like to use wxwidgets to add some gui elements to e.g. toggle render modes and to generally make debugging easier.
Unfortunably, I've got some problems creating an openGL context in wxwidgets.
I'm on win7 using mingw (x64 by TDM).
I've successfully compiled wxwidgets (3.1.2) from source, using
Code: Select all
mingw32-make.exe -f makefile.gcc MONOLITHIC=0 SHARED=1 UNICODE=1 USE_OPENGL=1 BUILD=release
mingw32-make.exe -f makefile.gcc MONOLITHIC=0 SHARED=1 UNICODE=1 USE_OPENGL=1 BUILD=debug
I've created a wxwidgets project in code::blocks IDE (using wxsmith as form editor).
I've added the wxwidget _gl lib/dll to the compiler/linker options. I'm also linking opengl32.
I've subclassed wxglCanvas (similar to the pyramid sample) and added that to my wxFrame (resp. to the layout of my frame).
When I compile & run, I get an error about some assert triggered on "tempcontext" inside wxglcanvas - e.g. there's something going wrong with the wxglcontext that is created automatically within the constructor of the wxglcanvas, but I'm unable to determine what exactly is going wrong.
On top of that the documentation is kind of confusing on this topic: "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." (https://docs.wxwidgets.org/trunk/classw ... anvas.html) - so, If that internal openglcontext was actually removed like the documentation says, I could create my own context w/attributes like opengl version?
I'm neither seeing a way to pass contextattributes into the wxglcanvas, nor a way to tell the canvas to not autogenerate a context, nor a way to pass a manually created context to the canvas (or vice versa).
So, how can I create an wxglcanvas and use a context with specific opengl context attributes, e.g. opengl version 4.2 and core profile?
PS: Searching for a solution, I came across http://www.lighthouse3d.com/2012/07/wor ... wx-wigets/ but unlike suggested, I'd rather not modify the library code.