Programming
Notes on setting up OpenGL with Wxwidgets









wxWidgets is a way to write Graphical User Interfaces (GUIs, with buttons, menus, etc) for Win32, Mac OS X, etc from C++, Python, Perl, and C#/.NET. Though it's cross-platform, the resulting programs don't look the same on all machines - they follow the look-and-feel of the machine.

wxWidgets is easy to use and it's nice that it's all C++ so one doesn't have to worry about wrappers or stuff like that.

This is a very simple example mainly just to get started setting up OpenGL with Wxwidgets. It was compiled with g++, the GNU C++ compiler (part of MinGW) for Windows. This is what you'll see;





The code uses the newer and recommended method for setting up OpenGL with Wxwidgets versions 2.7.x and later.

I was not able to find any examples using this newer method so this might be helpful to those getting started.

There are two files the header file and the implementation file.

Note that this program doesn't use glu.h (for the OpenGL utility library functions) simply because I don't have it on my machine for some reason.

That's why it doesn't use the gluPerspective function, but it's not a big problem we can just use the glFrustum function to set up the view frustum.