| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #include "ArenaScene.h"
- using namespace Crown;
- class WndCtrl: public KeyboardListener
- {
- public:
- WndCtrl()
- {
- GetDevice()->GetInputManager()->RegisterKeyboardListener(this);
- }
- virtual void KeyReleased(const KeyboardEvent& event)
- {
- if (event.key == KC_ESCAPE)
- {
- GetDevice()->StopRunning();
- }
- }
- };
- int main(int argc, char** argv)
- {
- int wndW = 800;
- int wndH = 480;
- if (argc == 3)
- {
- wndW = atoi(argv[1]);
- wndH = atoi(argv[2]);
- }
- Device* mDevice = GetDevice();
- if (!mDevice->Init(wndW, wndH, 32, false))
- {
- return 0;
- }
- WndCtrl ctrl;
- ArenaScene* mainScene = new ArenaScene(wndW, wndH);
- GetDevice()->GetSceneManager()->SelectNextScene(mainScene);
- mDevice->GetMainWindow()->SetTitle("Crown Engine v0.1 - Chainsaw Buffet");
- while (mDevice->IsRunning())
- {
- mDevice->Frame();
- }
- mDevice->Shutdown();
- return 0;
- }
|