]> git.jsancho.org Git - dungeon-master.git/blob - src/main.cpp
Some things
[dungeon-master.git] / src / main.cpp
1 /* Dungeon Master --- Adventure generator for GNU Guile
2    Copyright © 2019 Javier Sancho <jsf@jsancho.org>
3
4    Dungeon Master is free software; you can redistribute it and/or modify it
5    under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 3 of the License, or
7    (at your option) any later version.
8
9    Dungeon Master is distributed in the hope that it will be useful, but
10    WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with Haunt.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include <irrlicht/irrlicht.h>
19 #include "paths.h"
20
21 #include <iostream>
22
23 using namespace irr;
24 using namespace core;
25 using namespace video;
26 using namespace gui;
27
28 int main()
29 {
30   std::set<std::string> paths = get_data_paths();
31   for (std::set<std::string>::iterator it=paths.begin(); it!=paths.end(); it++)
32     std::cout << *it << std::endl;
33   IrrlichtDevice* device =
34     createDevice(EDT_OPENGL,
35                  dimension2d<u32>(640, 480), 16,
36                  false, false, false, 0);
37   if (!device)
38     return 1;
39
40   device->setWindowCaption(L"Dungeon Master");
41
42   IVideoDriver* driver = device->getVideoDriver();
43   IGUIEnvironment* env = device->getGUIEnvironment();
44
45   env->addStaticText(L"Dungeon Master", rect<s32>(150,20,350,40), true);
46
47   IGUITabControl* tab = env->addTabControl(rect<s32>(50, 60, 850, 600));
48   tab->addTab(L"First");
49   tab->addTab(L"Second");
50   tab->addTab(L"Third");
51
52   while (device->run())
53     {
54       driver->beginScene(true, true, SColor(0, 200, 200, 200));
55       env->drawAll();
56       driver->endScene();
57     }
58
59   device->drop();
60
61   return 0;
62 }