aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/tools/GUIEditor/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/irrlicht-1.8/tools/GUIEditor/main.cpp')
-rw-r--r--libraries/irrlicht-1.8/tools/GUIEditor/main.cpp152
1 files changed, 76 insertions, 76 deletions
diff --git a/libraries/irrlicht-1.8/tools/GUIEditor/main.cpp b/libraries/irrlicht-1.8/tools/GUIEditor/main.cpp
index e8434b2..1d917d3 100644
--- a/libraries/irrlicht-1.8/tools/GUIEditor/main.cpp
+++ b/libraries/irrlicht-1.8/tools/GUIEditor/main.cpp
@@ -1,76 +1,76 @@
1#include <irrlicht.h> 1#include <irrlicht.h>
2#include "driverChoice.h" 2#include "driverChoice.h"
3 3
4// include the gui creator element factory 4// include the gui creator element factory
5#include "CGUIEditFactory.h" 5#include "CGUIEditFactory.h"
6 6
7using namespace irr; 7using namespace irr;
8using namespace gui; 8using namespace gui;
9 9
10#ifdef _MSC_VER 10#ifdef _MSC_VER
11#pragma comment(lib, "Irrlicht.lib") 11#pragma comment(lib, "Irrlicht.lib")
12#endif 12#endif
13 13
14int main() 14int main()
15{ 15{
16 // ask user for driver 16 // ask user for driver
17 video::E_DRIVER_TYPE driverType=driverChoiceConsole(); 17 video::E_DRIVER_TYPE driverType=driverChoiceConsole();
18 if (driverType==video::EDT_COUNT) 18 if (driverType==video::EDT_COUNT)
19 return 1; 19 return 1;
20 20
21 IrrlichtDevice *device = createDevice(driverType, core::dimension2du(800, 600)); 21 IrrlichtDevice *device = createDevice(driverType, core::dimension2du(800, 600));
22 video::IVideoDriver* driver = device->getVideoDriver(); 22 video::IVideoDriver* driver = device->getVideoDriver();
23 scene::ISceneManager* smgr = device->getSceneManager(); 23 scene::ISceneManager* smgr = device->getSceneManager();
24 gui::IGUIEnvironment *env = device->getGUIEnvironment(); 24 gui::IGUIEnvironment *env = device->getGUIEnvironment();
25 25
26 device->setResizable(true); 26 device->setResizable(true);
27 27
28 /* 28 /*
29 first we create the factory which can make new GUI elements 29 first we create the factory which can make new GUI elements
30 and register it with the gui environment. 30 and register it with the gui environment.
31 */ 31 */
32 32
33 IGUIElementFactory* factory = new CGUIEditFactory(env); 33 IGUIElementFactory* factory = new CGUIEditFactory(env);
34 env->registerGUIElementFactory(factory); 34 env->registerGUIElementFactory(factory);
35 // remember to drop since we created with a create call 35 // remember to drop since we created with a create call
36 factory->drop(); 36 factory->drop();
37 37
38 IGUISkin *skin = env->createSkin(EGST_WINDOWS_METALLIC); 38 IGUISkin *skin = env->createSkin(EGST_WINDOWS_METALLIC);
39 env->setSkin(skin); 39 env->setSkin(skin);
40 40
41 IGUIFont *font = env->getFont("../../media/lucida.xml"); 41 IGUIFont *font = env->getFont("../../media/lucida.xml");
42 if (font) 42 if (font)
43 skin->setFont(font); 43 skin->setFont(font);
44 skin->drop(); 44 skin->drop();
45 45
46 // change transparency of skin 46 // change transparency of skin
47 for (s32 i=0; i<gui::EGDC_COUNT ; ++i) 47 for (s32 i=0; i<gui::EGDC_COUNT ; ++i)
48 { 48 {
49 video::SColor col = env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i); 49 video::SColor col = env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);
50 col.setAlpha(250); 50 col.setAlpha(250);
51 env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col); 51 env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);
52 } 52 }
53 53
54 /* 54 /*
55 now we add the GUI Editor Workspace 55 now we add the GUI Editor Workspace
56 */ 56 */
57 57
58 env->addGUIElement("GUIEditor"); 58 env->addGUIElement("GUIEditor");
59 59
60 while(device->run()) 60 while(device->run())
61 { 61 {
62 device->sleep(10); 62 device->sleep(10);
63 63
64 if (device->isWindowActive()) 64 if (device->isWindowActive())
65 { 65 {
66 driver->beginScene(true, true, video::SColor(0,200,200,200)); 66 driver->beginScene(true, true, video::SColor(0,200,200,200));
67 smgr->drawAll(); 67 smgr->drawAll();
68 env->drawAll(); 68 env->drawAll();
69 driver->endScene(); 69 driver->endScene();
70 } 70 }
71 } 71 }
72 72
73 device->drop(); 73 device->drop();
74 74
75 return 0; 75 return 0;
76} 76}