Ashwin Nanjappa
http://www.comp.nus.edu.sg/~ashwinna/
Download the wxWidgets Windows installer (wxMSW) and install it. It installs the directory structure and the source code. The code still needs to be compiled into libraries for usage.
Add the environment variable WX_WIDGETS_ROOT with value as the directory where wxWidgets was installed. (Ex: C:\Program Files\wxWidgets-2.8.9)
Edit $(WX_WIDGETS_ROOT)\include\wx\msw\setup.h and change:
To use the OpenGL canvas of wxWidgets, set wxUSE_GLCANVAS to 1.
To redirect cout or cerr to a text control, set wxUSE_STD_IOSTREAM to 1.
Open $(WX_WIDGETS_ROOT)\build\msw\wx.dsw and build the Debug and Release versions for static libraries. By default it builds as Multi-threaded Debug DLL. Go to each individual sub-project and change property of C/C++ → Code Generation → RunTimeLibary to Multi-threaded Debug/Release.
In your Visual Studio project, make these changes:
Include directories:
$(WX_WIDGETS_ROOT)/include$(WX_WIDGETS_ROOT)/lib/vc_lib/mswdLibrary directories:
$(WX_WIDGETS_ROOT)/lib/vc_libwxWidgets is a GUI library, using it will change your program into a Window application. It is no longer a Console application. This means that the console no longer appears and also that main() function is no longer invoked.
Go to Linker → System → Subsystem and change its value from CONSOLE to WINDOWS.
Remove _CONSOLE from Include directives.
Link with the following libraries:
(Remove the d for release versions)
comctl32.lib (Windows Common controls (commctrl.h))rpcrt4.lib (Windows RPC (rpc.h))wxbase28d.lib (wxWidgets Base)wxmsw28d_core.lib (wxWidgets MS Windows Base Core)wxmsw28d_gl.lib (wxWidgets MS Windows OpenGL)(Only if you want to use multisampling.)
From:
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1915804&group_id=9863
Patch these files:
$(WX_WIDGETS_ROOT)/include/wx/glcanvas.h$(WX_WIDGETS_ROOT)/include/wx/msw/glcanvas.h$(WX_WIDGETS_ROOT)/src/msw/glcanvas.cppIn the source file add the following lines:
int attribList[] = {WX_GL_RGBA,
WX_GL_DOUBLEBUFFER,
WX_GL_SAMPLE_BUFFERS, GL_TRUE, // Required only for multi-sampling (AA)
WX_GL_SAMPLES, 4, // Required only for supersampling
WX_GL_DEPTH_SIZE, 16,
0, 0};
Change the constructor to:
wxGLCanvas(..., attribList)
Note that all the attributes need to be set in the attribList. Just setting the interesting values of GL_SAMPLE_BUFFERS do not work causing glewInit() to fail.