OSDN Git Service

fix build system ofmoflib1 and saisei1
[moflib/moflib.git] / saisei-1.0 / src / main.cpp
1 #include "configure.hpp"
2 #include "mof/Application.hpp"
3 #include "mof/streams.hpp"
4 #include "mof/Color.hpp"
5 #include <exception>
6 #include "mof/utilities.hpp"
7 #include "mof/ConsoleIO.hpp"
8 #include <conio.h>
9 #include "mof/Font.hpp"
10
11 #include "TestScene.hpp"
12 #include "Demo1.hpp"
13 #include "Demo2.hpp"
14 #include "Demo3.hpp"
15 #include "Settings.hpp"
16
17
18 int main(int , char**)
19 {
20     mof::Font::addFontResource( FONT_PATH_UME );
21         ::Settings settings;
22         int result = ::LoadSettings(&settings);
23         try
24         {
25                 if (!result) throw std::runtime_error("bad settings");
26             { // \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\8f\89\8aú\89»
27                         int upf = settings.fps == 30 ? 2 : 1;
28                         int interval = settings.fps == 30 ? 32 : 16;
29                     mof::Application::initialize
30                     (
31                         _T("MyApplication") ,
32                         settings.screen.width, settings.screen.height,
33                                 settings.screen_mode, interval, upf,
34                                 (mof::Application::InputMode)settings.input_mode, 
35                                 settings.enable_output_frame? true: false,
36                                 settings.enable_output_audio? true: false
37                     ); 
38                 }
39                 
40                 { // \83V\81[\83\93\82Ì\83Z\83b\83g\82Æ\8aJ\8en
41                     mof::Scene scene;
42                     #define FIRST_SCENE Demo1
43                     scene.initialize = FIRST_SCENE::initialize;
44                     scene.finalize = FIRST_SCENE::finalize;
45                     scene.update = FIRST_SCENE::update;
46                     scene.draw = FIRST_SCENE::draw;
47                     mof::Application::run( scene );
48                 }
49         }
50         catch(std::exception& e)
51         {
52                 MessageBox(NULL, e.what(), "\97á\8aO\82ª\94­\90\82µ\82Ü\82µ\82½", MB_OK);
53         }
54         mof::Application::finalize();
55
56         return 0;
57 }