From 0a02289e12a039fab5508933afe544cd571c1caf Mon Sep 17 00:00:00 2001 From: pixel Date: Sat, 17 Jul 2004 10:08:15 +0000 Subject: Starting up Dalos --- Dalos/Dalos.cc | 115 +++++++++++++++++++++++++++++++++++++++++++++ MSVC/Dalos/Dalos.vcproj | 116 ++++++++++++++++++++++++++++++++++++++++++++++ MSVC/PSX-Bundle.sln | 10 ++++ MSVC/mogltk/mogltk.vcproj | 80 ++++++++++++++++---------------- 4 files changed, 282 insertions(+), 39 deletions(-) create mode 100644 Dalos/Dalos.cc create mode 100644 MSVC/Dalos/Dalos.vcproj diff --git a/Dalos/Dalos.cc b/Dalos/Dalos.cc new file mode 100644 index 0000000..c9d8763 --- /dev/null +++ b/Dalos/Dalos.cc @@ -0,0 +1,115 @@ +#include +#include + +#include +#include +#include + +mogltk::widgets::Root * Root; +mogltk::widgets::Frame * Frame; +mogltk::widgets::Menu * MainMenu; + +CODE_BEGINS + +class frame : public mogltk::widget { + public: + frame(mogltk::shape * sh, mogltk::widget * father) : + widget(father, 2, 2, father->GetW() - 4, father->GetH() - 4, 0, "MyFrame", sh) { } + protected: + virtual void draw() { + } + virtual bool process_event(int mx, int my, mogltk::event_t event) { + return false; + } +}; + +class timer : public mogltk::widget { + public: + timer() : + widget(Root, 0, 0, 0, 0, 0, "Timer", 0), tick(0) + { set_timed_event(100); } + protected: + virtual bool process_event(int, int, mogltk::event_t event) { + if (event == mogltk::E_TIMER) { + set_timed_event(100); + tick = (tick + 1) % 4; + switch (tick) { + case 0: + MainMenu->SetCaption(0, "/"); + break; + case 1: + MainMenu->SetCaption(0, "-"); + break; + case 2: + MainMenu->SetCaption(0, "\\"); + break; + case 3: + MainMenu->SetCaption(0, "I"); + break; + } + return true; + } + return false; + } + private: + int tick; +}; + +class quit : public mogltk::widgets::action { + public: + virtual void do_action(mogltk::widget * w) { + mogltk::engine::quit(); + } +} action_quit; + +class about : public mogltk::widgets::action { + public: + virtual void do_action(mogltk::widget * w) { + new mogltk::widgets::MsgBox(w->Shaper(), w->Father(), "About...", + "Dalos version 0.1 - OpenGL version\n" + "Copyright (C) 2004 Nicolas \"Pixel\" Noble\n" + "\n" + "Thanks and greetings fly to (no particular order)\n" + "GreatSkaori, Orphis, Ti Dragon, Yaz0r, S-O-R,\n" + "Meradrin, SkeuD, Moogle, InVerse, LavosSpawn\n" + "\n" + "And to all I forgot!\n" + ); + } +} about_dialog; + +virtual int startup() throw (GeneralException) { + mogltk::widgets::ContextMenu * c; + mogltk::base * gl = new mogltk::glbase(); + mogltk::shape * sh = new mogltk::glshape(); + + mogltk::engine::setcursorvisible(true); + mogltk::engine::setappactive(true); + + Root = new mogltk::widgets::Root(sh); + MainMenu = new mogltk::widgets::Menu(sh, Root); + Frame = new mogltk::widgets::Frame(sh, Root, 0, MainMenu->GetH(), Root->GetW() - 1, Root->GetH() - MainMenu->GetH() - 1); + new frame(sh, Frame); + + MainMenu->addnode("/", 0); + + c = MainMenu->createsub("File"); + c->addnode("Load", 0); + c->addnode("Save", 0); + c->addline(); + c->addnode("Quit", &action_quit); + + c = MainMenu->createsub("Execution"); + c->addnode("Run", 0); + + c = MainMenu->createsub("Help"); + c->addnode("About", &about_dialog); + + new timer(); + + Root->mainloop(); + + return 0; +} + +CODE_ENDS diff --git a/MSVC/Dalos/Dalos.vcproj b/MSVC/Dalos/Dalos.vcproj new file mode 100644 index 0000000..fc004fb --- /dev/null +++ b/MSVC/Dalos/Dalos.vcproj @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MSVC/PSX-Bundle.sln b/MSVC/PSX-Bundle.sln index 8fbcd8d..df4c83f 100644 --- a/MSVC/PSX-Bundle.sln +++ b/MSVC/PSX-Bundle.sln @@ -7,6 +7,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tools", "Tools\Tools.vcproj EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mogltk", "mogltk\mogltk.vcproj", "{34BCDA3E-D3E2-4A8D-BF73-7D770EE6966A}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dalos", "Dalos\Dalos.vcproj", "{22F8F8CD-B256-446D-9B42-09CE83F74885}" +EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug @@ -16,6 +18,10 @@ Global {0A2CD193-F270-4F2B-943C-F8BDF792D25C}.0 = {879D8D90-9A7E-4F3C-9B4E-F1648C8AE927} {6CAE7F4D-C27B-43F3-B30A-84C5F32EFA29}.0 = {0A2CD193-F270-4F2B-943C-F8BDF792D25C} {6CAE7F4D-C27B-43F3-B30A-84C5F32EFA29}.1 = {879D8D90-9A7E-4F3C-9B4E-F1648C8AE927} + {34BCDA3E-D3E2-4A8D-BF73-7D770EE6966A}.0 = {879D8D90-9A7E-4F3C-9B4E-F1648C8AE927} + {22F8F8CD-B256-446D-9B42-09CE83F74885}.0 = {879D8D90-9A7E-4F3C-9B4E-F1648C8AE927} + {22F8F8CD-B256-446D-9B42-09CE83F74885}.1 = {34BCDA3E-D3E2-4A8D-BF73-7D770EE6966A} + {22F8F8CD-B256-446D-9B42-09CE83F74885}.2 = {0A2CD193-F270-4F2B-943C-F8BDF792D25C} EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {879D8D90-9A7E-4F3C-9B4E-F1648C8AE927}.Debug.ActiveCfg = Debug|Win32 @@ -34,6 +40,10 @@ Global {34BCDA3E-D3E2-4A8D-BF73-7D770EE6966A}.Debug.Build.0 = Debug|Win32 {34BCDA3E-D3E2-4A8D-BF73-7D770EE6966A}.Release.ActiveCfg = Release|Win32 {34BCDA3E-D3E2-4A8D-BF73-7D770EE6966A}.Release.Build.0 = Release|Win32 + {22F8F8CD-B256-446D-9B42-09CE83F74885}.Debug.ActiveCfg = Debug|Win32 + {22F8F8CD-B256-446D-9B42-09CE83F74885}.Debug.Build.0 = Debug|Win32 + {22F8F8CD-B256-446D-9B42-09CE83F74885}.Release.ActiveCfg = Release|Win32 + {22F8F8CD-B256-446D-9B42-09CE83F74885}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection diff --git a/MSVC/mogltk/mogltk.vcproj b/MSVC/mogltk/mogltk.vcproj index 05f2719..c4ea69b 100644 --- a/MSVC/mogltk/mogltk.vcproj +++ b/MSVC/mogltk/mogltk.vcproj @@ -19,6 +19,7 @@ + RelativePath="..\..\mogltk\lib\base.cc"> + RelativePath="..\..\mogltk\include\base.h"> + RelativePath="..\..\mogltk\lib\glbase.cc"> + RelativePath="..\..\mogltk\include\glbase.h"> + RelativePath="..\..\mogltk\lib\engine.cc"> + RelativePath="..\..\mogltk\include\engine.h"> + RelativePath="..\..\mogltk\lib\font.cc"> + RelativePath="..\..\mogltk\include\font.h"> + RelativePath="..\..\mogltk\lib\glfont.cc"> + RelativePath="..\..\mogltk\include\glfont.h"> + + + + + + - - - - - - + RelativePath="..\..\mogltk\lib\glsprite.cc"> + RelativePath="..\..\mogltk\include\glsprite.h"> + RelativePath="..\..\mogltk\lib\sprite.cc"> + RelativePath="..\..\mogltk\include\sprite.h"> + RelativePath="..\..\mogltk\lib\texture.cc"> + RelativePath="..\..\mogltk\include\texture.h"> + + + RelativePath="..\..\mogltk\lib\glwidgets.cc"> + RelativePath="..\..\mogltk\include\glwidgets.h"> - - + RelativePath="..\..\mogltk\lib\widgets.cc"> + RelativePath="..\..\mogltk\include\widgets.h"> -- cgit v1.2.3