I finally got Multisampling working with my wxWidgets OpenGL program. It's a bit messy right now, but here's how:
wxWidgets does not support Multisampling in its stable versions (the latest version is currently 2.8.8 ). But it is available as a patch, as well as through a daily snapshot. (The latter is encouraging, as this means that the patch has been adopted and should appear in later stable versions if there are no problems.)
So, there are 2 options:
, , . , Windows, . .
, Windows :
$(WX_WIDGETS_ROOT)/include/wx/glcanvas.h
$(WX_WIDGETS_ROOT)/include/wx/msw/glcanvas.h
$(WX_WIDGETS_ROOT)/src/msw/glcanvas.cpp
wxWidgets.
OpenGL wxWidgets, .
wxGLCanvas:
int attribList[] = {WX_GL_RGBA,
WX_GL_DOUBLEBUFFER,
WX_GL_SAMPLE_BUFFERS, GL_TRUE,
WX_GL_DEPTH_SIZE, 16,
0, 0};
, GL_SAMPLE_BUFFERS, GL_TRUE. Else, .
wxGLCanvas, :
myGLFrame::myGLFrame
(
wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name
)
: wxGLCanvas(parent, (wxGLCanvas*) NULL, id, pos, size, style, name, attribList)
{
}
wxGLCanvas . , OpenGL:
glEnable(GL_MULTISAMPLE);
glDisable(GL_MULTISAMPLE);
OpenGL wxWidgets. , wxWidgets , : -)