Public Member Functions | |
Application () | |
~Application () | |
void | quit () |
bool | getQuit () const |
void | run () |
Private Member Functions | |
void | init () |
Private Attributes | |
ContextActor * | m_actor |
helloAction * | m_hello |
System * | m_system |
bool | m_quit |
Definition at line 42 of file demo.cpp.
Application::Application | ( | ) | [inline] |
Application::~Application | ( | ) | [inline] |
bool Application::getQuit | ( | ) | const [inline] |
void Application::init | ( | ) | [inline, private] |
Definition at line 74 of file demo.cpp.
References cmil::SDL::SDLSystem::Parameters::add(), cmil::ContextActor::addNormal(), cmil::SDL::Keyboards, m_actor, m_hello, m_system, and cmil::SDL::Mice.
Referenced by Application().
00074 { 00075 if( SDL_Init( SDL_INIT_VIDEO ) < 0){ 00076 fprintf( stderr, "Could not initialise SDL: %s\n", SDL_GetError() ); 00077 exit( -1 ); 00078 } 00079 00080 if( !SDL_SetVideoMode( 0, 0, 0, SDL_HWSURFACE | SDL_RESIZABLE ) ) { 00081 fprintf( stderr, "Could not set video mode: %s\n", SDL_GetError() ); 00082 SDL_Quit(); 00083 exit( -1 ); 00084 } 00085 00086 SDL_WM_SetCaption("demoing cmil alpha 0.91", "demo"); 00087 SDL_EnableUNICODE(1); 00088 00089 std::cout << "SDL initialized." << std::endl; 00090 std::cout << std::endl; 00091 00092 SDL::SDLSystem::Parameters params; 00093 00095 00096 params.add(SDL::Mice, new WidgetMouse()); 00097 params.add(SDL::Keyboards); 00098 00099 m_system = new SDL::SDLSystem(params); 00100 00103 00104 m_actor = new ContextActor(m_system); 00105 00106 m_system -> attach(m_actor); 00107 00108 m_actor->addNormal( Ev("Keyboard", "F") << m_hello ); 00109 m_actor->addNormal( Ev("Keyboard", "Ctrl") << Ev("Keyboard", "F") << m_hello ); 00110 m_actor->addNormal( Ev("WidgetMouse", "WidgetMotion") << m_hello ); 00111 m_actor->addNormal( Ev("WidgetMouse", "WidgetLeftButton") << m_hello ); 00112 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Application::quit | ( | ) | [inline] |
void Application::run | ( | ) | [inline] |
Definition at line 64 of file demo.cpp.
References cmil::ContextActor::getQuit(), m_actor, m_system, and cmil::System::poll().
Referenced by main().
00064 { 00065 while(!m_actor->getQuit()) { 00066 m_system->poll(); 00067 SDL_Delay(1); 00068 } 00069 00070 SDL_Quit(); 00071 }
Here is the call graph for this function:
Here is the caller graph for this function:
ContextActor* Application::m_actor [private] |
helloAction* Application::m_hello [private] |
bool Application::m_quit [private] |
System* Application::m_system [private] |