X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f50a1c3d667fb948bfbdcbd4b3021d896c6635cd..6cd674726b8ae173a567410b03bfa94423c69926:/samples/opengl/isosurf/isosurf.cpp?ds=sidebyside diff --git a/samples/opengl/isosurf/isosurf.cpp b/samples/opengl/isosurf/isosurf.cpp index 2cc7b686dd..f602caeeb4 100644 --- a/samples/opengl/isosurf/isosurf.cpp +++ b/samples/opengl/isosurf/isosurf.cpp @@ -9,11 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation -#pragma interface -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -54,6 +49,8 @@ #include "isosurf.h" +#include "../../sample.xpm" + // The following part is taken largely unchanged from the original C Version GLboolean speed_test = GL_FALSE; @@ -77,7 +74,7 @@ static GLfloat yrot; static void read_surface( const wxChar *filename ) { - FILE *f = wxFopen(wxFNCONV(filename),_T("r")); + FILE *f = wxFopen(filename,_T("r")); if (!f) { wxString msg = _T("Couldn't read "); @@ -249,6 +246,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + Args(argc, argv); // Create the main frame window @@ -275,7 +275,7 @@ bool MyApp::OnInit() int gl_attrib[20] = { WX_GL_RGBA, WX_GL_MIN_RED, 1, WX_GL_MIN_GREEN, 1, WX_GL_MIN_BLUE, 1, WX_GL_DEPTH_SIZE, 1, WX_GL_DOUBLEBUFFER, -# ifdef __WXMAC__ +# if defined(__WXMAC__) || defined(__WXCOCOA__) GL_NONE }; # else None }; @@ -315,6 +315,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, : wxFrame(frame, wxID_ANY, title, pos, size, style) { m_canvas = NULL; + SetIcon(wxIcon(sample_xpm)); } MyFrame::~MyFrame() @@ -344,7 +345,7 @@ END_EVENT_TABLE() TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name, int* gl_attrib) - : wxGLCanvas(parent, id, pos, size, style, name, gl_attrib) + : wxGLCanvas(parent, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name, gl_attrib) { parent->Show(true); SetCurrent();