Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SimpleGLApp.cpp
1 #ifdef WIN32
2 # pragma warning (disable: 4005) // for VS8 + WX
3 #endif
4 
5 #include "SimpleGLApp.hh"
6 #include "SimpleGLFrame.hh"
7 #include <Gui/ConsoleRedirectIO.hh> // BIAS
8 
9 using namespace std;
10 using namespace BIAS;
11 
12 // required for wx RTTI dynamic construction:
13 //IMPLEMENT_APP(SimpleGLApp);
14 
15 
16 
18 :wxGLApp()
19 ,frame(NULL)
20 ,scene(NULL)
21 {}
22 
23 
24 // dummy implementation
26  BIASASSERT(this->frame!=NULL);
27  BIASASSERT(this->frame->pCanvas!=NULL);
28 
29  this->frame->pCanvas->pScene = this->scene;
30 }
31 
33  BIASASSERT(this->frame!=NULL);
34  BIASASSERT(this->frame->pCanvas!=NULL);
35  this->scene->pc = arg_pc;
36 }
37 
38 // main entry routine
40 {
41  ConsoleRedirectIO(); //< utility: create a Redirection console for cout, cerr etc.
42  cout << "Hello cout" << endl; //< testing output:
43  cout << "Hello cerr" << endl;
44 
45  this->frame =
46  new SimpleGLFrame( _T("SimpleGLApp frame"), wxPoint(0, 0),
47  wxSize(640, 480));
48 
49  SetScene();
50  BIASASSERT(this->frame->pCanvas!=NULL);
51  SetCanvas(this->frame->pCanvas);
52 
53  frame->Show(TRUE);
54  SetTopWindow(frame);
55  return TRUE;
56 }
void BIASGui_EXPORT ConsoleRedirectIO(std::string name=std::string(""))
Extra Console for WIN32 WinMain gui applications.
OpenGL canvases with additinal event handling (JW)
Definition: OpenGLCanvas.hh:68
Helper frame for SimplaGLApp.
virtual void SetScene()
Definition: SimpleGLApp.cpp:25
virtual bool OnInit()
main equivalent
Definition: SimpleGLApp.cpp:39
virtual void SetCanvas(BIAS::OpenGLCanvas *arg_pc)
Definition: SimpleGLApp.cpp:32