![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsWXAppMain.cpp 00003 00004 WXAppMain (a subclass of class wxApp) is 00005 an Application Object ( equivalent to main() ). 00006 00007 SUKITTI PUNAK (05/05/2006) 00008 UPDATE (05/05/2006) 00009 ******************************************************************************/ 00010 #include "TAPsWXAppMain.hpp" 00011 // Using Inclusion Model (i.e. definitions are included in declarations) 00012 // (this name.cpp is included in name.hpp) 00013 // Each friend is defined directly inside its declaration. 00014 00015 //============================================================================= 00016 //----------------------------------------------------------------------------- 00017 #if defined (__GNUG__) && !defined (__APPLE__) 00018 #pragma implementation 00019 #pragma interface 00020 #endif 00021 00022 // For compilers that support precompilation, includes "wx.h" 00023 #include "wx/wxprec.h" 00024 00025 #ifdef __BORLANDC__ 00026 #pragma hdrstop 00027 #endif 00028 00029 #ifndef WX_PRECOMP 00030 #include "wx/wx.h" 00031 #endif 00032 00033 #if !wxUSE_GLCANVAS 00034 #error "OpenGL required: set wxUSE_GLCANVAS to 1 and rebuild the library" 00035 #endif 00036 00037 //#include "wxMain.hpp" 00038 //#include "sample.xpm" 00039 00040 #ifndef __WXMSW__ // for StopWatch, see remark below 00041 #if defined (__WXMAC__) && !defined (__DARWIN__) 00042 #include <utime.h> 00043 #include <unistd.h> 00044 #else 00045 #include <sys/time.h> 00046 #include <sys/unistd.h> 00047 #endif 00048 #else 00049 #include <sys/timeb.h> 00050 #endif 00051 //----------------------------------------------------------------------------- 00052 //============================================================================= 00053 00054 BEGIN_NAMESPACE_TAPs 00055 //============================================================================= 00056 // Application Object ( equivalent to main() ) 00057 //----------------------------------------------------------------------------- 00058 IMPLEMENT_APP( WXAppMain ) 00059 //----------------------------------------------------------------------------- 00060 bool WXAppMain::OnInit () 00061 { 00062 // Create the main frame window 00063 //(void) MainGLFrame::Create( NULL ); 00064 WXFrameSupportGLCanvas * mainFrame = 00065 WXFrameSupportGLCanvas::Create( NULL ); 00066 00067 // Initialize OpenGL (see InitGL Fn) 00068 OpenGL::BaseOpenGLManager<Real> * pGLManager = new OpenGL::OpenGLManager<Real>(); 00069 //pGLManager->Setup( mainFrame->RetGLCanvasPtr() ); 00070 pGLManager->InitGL(); 00071 mainFrame->RetGLCanvasPtr()->Setup( pGLManager ); 00072 mainFrame->RetGLCanvasPtr()->InitGL(); 00073 wxSizeEvent *e = NULL; 00074 mainFrame->RetGLCanvasPtr()->OnSize( *e ); 00075 00076 00077 //SetTopWindow(frame); 00078 //g_wxOpenGLMainWindow = mainFrame; 00079 00080 return true; 00081 } 00082 //----------------------------------------------------------------------------- 00083 //============================================================================= 00084 END_NAMESPACE_TAPs 00085 //----------------------------------------------------------------------------- 00086 //345678901234567890123456789012345678901234567890123456789012345678901234567890 00087 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8