Search code examples
openglwxwidgets

Enabling OpenGL in wxWidgets


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?


Solution

  • 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)