views:

1665

answers:

3

I installed the wxWidgets source code, compiled it and am linking the libraries thus obtained with my application code. Now I need to use OpenGL in my wxWidgets application. How do I enable this?

A: 

(Assume $(WXWIDGETSROOT) is the root directory of your wxWidgets installation.)

  1. Open the file $(WXWIDGETSROOT)\include\wx\msw\setup.h
  2. Search and find the option wxUSE_GLCANVAS. Change its value from 0 to 1.
  3. Recompile the library.
Ashwin
+2  A: 

If you're using configure to build wxWidgets you just need to add --with-opengl to your command line.

Jason Weathered
+3  A: 

For building on Windows with project files:

Assume $(WXWIDGETSROOT) is the root directory of your wxWidgets installation.

  1. Open the file $(WXWIDGETSROOT)\include\wx\msw\setup.h
  2. Search for the #define for wxUSE_GLCANVAS.
  3. Change its value from 0 to 1.
  4. Recompile the library.

For building on Linux and other ./configure based platforms:

Just use ./configure --with-opengl

(A mashup answer from two partial answers given by others)

Baxissimo