annotate engine/core/controller/engine.i @ 697:ecaa4d98f05f tip

Abstracted the GUI code and refactored the GUIChan-specific code into its own module. * Most of the GUIChan code has been refactored into its own gui/guichan module. However, references to the GuiFont class still persist in the Engine and GuiManager code and these will need further refactoring. * GuiManager is now an abstract base class which specific implementations (e.g. GUIChan) should subclass. * The GUIChan GUI code is now a concrete implementation of GuiManager, most of which is in the new GuiChanGuiManager class. * The GUI code in the Console class has been refactored out of the Console and into the GUIChan module as its own GuiChanConsoleWidget class. The rest of the Console class related to executing commands was left largely unchanged. * Existing client code may need to downcast the GuiManager pointer received from FIFE::Engine::getGuiManager() to GuiChanGuiManager, since not all functionality is represented in the GuiManager abstract base class. Python client code can use the new GuiChanGuiManager.castTo static method for this purpose.
author M. George Hansen <technopolitica@gmail.com>
date Sat, 18 Jun 2011 00:28:40 -1000
parents ca1fcb96907d
children
rev   line source
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
1 /***************************************************************************
632
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
2 * Copyright (C) 2005-2010 by the FIFE team *
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
3 * http://www.fifengine.net *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
4 * This file is part of FIFE. *
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
5 * *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
6 * FIFE is free software; you can redistribute it and/or *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
7 * modify it under the terms of the GNU Lesser General Public *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
8 * License as published by the Free Software Foundation; either *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
9 * version 2.1 of the License, or (at your option) any later version. *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
10 * *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
11 * This library is distributed in the hope that it will be useful, *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
14 * Lesser General Public License for more details. *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
15 * *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
16 * You should have received a copy of the GNU Lesser General Public *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
17 * License along with this library; if not, write to the *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
18 * Free Software Foundation, Inc., *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
20 ***************************************************************************/
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
21 %module fife
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
22 %{
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23 #include "controller/engine.h"
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
24 %}
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
25
694
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
26 %header %{
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
27 typedef void (*Callback)();
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
28
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
29 PyObject *prerender_callback = 0;
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
30 PyObject *postrender_callback = 0;
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
31
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
32 void preRenderCallback() {
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
33 if (prerender_callback > 0) {
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
34 PyEval_CallFunction(prerender_callback, "()");
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
35 }
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
36 }
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
37 void postRenderCallback() {
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
38 if (postrender_callback > 0) {
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
39 PyEval_CallFunction(postrender_callback, "()");
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
40 }
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
41 }
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
42 %}
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
43
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
44 %typemap(in) PyObject *callback {
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
45 if (!PyCallable_Check($input)) {
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
46 PyErr_SetString(PyExc_TypeError, "Need a callable object!");
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
47 return 0;
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
48 }
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
49 $1 = $input;
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
50 }
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
51
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
52 namespace FIFE {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
53
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
54 class SoundManager;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
55 class EventManager;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
56 class TimeManager;
697
ecaa4d98f05f Abstracted the GUI code and refactored the GUIChan-specific code into its own module.
M. George Hansen <technopolitica@gmail.com>
parents: 694
diff changeset
57 class GuiManager;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
58 class ImagePool;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
59 class AnimationPool;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
60 class SoundClipPool;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
61 class RenderBackend;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
62 class Model;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
63 class LogManager;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
64 class GuiFont;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
65 class VFS;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
66 class Cursor;
422
9d94f4676d17 Moved the management of cameras into the Map class. The View class no longer exists since it now serves no purpose. The engine class itself holds the renderers and these get passed to each map that is loaded and then passed to each camera on each map. This change makes it possible for multiple maps to be loaded at the same time with the same camera id without a name clash. fixes[t:342]
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 144
diff changeset
67 class RendererBase;
635
3094988564d5 * Added a simple method to query the default video card capabilities. This is still a work in progress. You can now get a list of ScreenModes the device supports. ScreenMode includes information on the screen resolution, if the mode is fullscreen/windowed and if it would use the OpenGL or SDL renderer.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 632
diff changeset
68 class DeviceCaps;
642
6e2151325017 * Added the ability to query the current running screen mode
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 640
diff changeset
69 class ScreenMode;
654
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
70 class Image;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
71
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
72 class EngineSettings {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
73 public:
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
74 ~EngineSettings();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
75 void validate() const;
632
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
76 void setBitsPerPixel(uint8_t bitsperpixel);
650
51bbda7676f0 * Fixed some more integer definitions
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 642
diff changeset
77 uint16_t getBitsPerPixel() const;
51bbda7676f0 * Fixed some more integer definitions
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 642
diff changeset
78 std::vector<uint16_t> getPossibleBitsPerPixel() const;
632
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
79 std::vector<std::pair<uint16_t, uint16_t> > getPossibleResolutions() const;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
80 void setFullScreen(bool fullscreen);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
81 bool isFullScreen() const;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
82 void setInitialVolume(float volume);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
83 float getInitialVolume() const;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
84 float getMaxVolume() const;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
85 void setRenderBackend(const std::string& renderbackend);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
86 const std::string getRenderBackend() const;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
87 std::vector<std::string> getPossibleRenderBackends();
444
79678719d569 * Fixed the sld typo. fixes[ticket:463]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 425
diff changeset
88 void setSDLRemoveFakeAlpha(bool sdlremovefakealpha);
79678719d569 * Fixed the sld typo. fixes[ticket:463]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 425
diff changeset
89 bool isSDLRemoveFakeAlpha(bool sdlremovefakealpha) const;
632
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
90 void setScreenWidth(uint16_t screenwidth);
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
91 uint16_t getScreenWidth() const;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
92 void setScreenHeight(uint16_t screenheight);
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
93 uint16_t getScreenHeight() const;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
94 void setDefaultFontPath(const std::string& defaultfontpath);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
95 std::string getDefaultFontPath() const;
632
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
96 void setDefaultFontSize(uint16_t defaultfontsize);
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
97 uint16_t getDefaultFontSize() const;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
98 void setDefaultFontGlyphs(const std::string& defaultfontglyphs);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
99 std::string getDefaultFontGlyphs() const;
61
18c2a21ac0ad allow clients to set a custom window title and icon
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 46
diff changeset
100 void setWindowTitle(const std::string& title);
18c2a21ac0ad allow clients to set a custom window title and icon
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 46
diff changeset
101 std::string getWindowTitle() const;
18c2a21ac0ad allow clients to set a custom window title and icon
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 46
diff changeset
102 void setWindowIcon(const std::string& icon);
18c2a21ac0ad allow clients to set a custom window title and icon
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 46
diff changeset
103 std::string getWindowIcon() const;
425
ad7969d9460b A client can now specify a global color key to be used with all images. The default color key is (255,0,255) in RGB format. Also the client can enable/disable the color key feature by using the setColorKeyEnabled function in the EngineSettings class. By default the color key feature is disabled. fixes[t:451]
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 422
diff changeset
104 void setColorKeyEnabled(bool colorkeyenable);
ad7969d9460b A client can now specify a global color key to be used with all images. The default color key is (255,0,255) in RGB format. Also the client can enable/disable the color key feature by using the setColorKeyEnabled function in the EngineSettings class. By default the color key feature is disabled. fixes[t:451]
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 422
diff changeset
105 bool isColorKeyEnabled() const;
632
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 621
diff changeset
106 void setColorKey(uint8_t r, uint8_t g, uint8_t b);
425
ad7969d9460b A client can now specify a global color key to be used with all images. The default color key is (255,0,255) in RGB format. Also the client can enable/disable the color key feature by using the setColorKeyEnabled function in the EngineSettings class. By default the color key feature is disabled. fixes[t:451]
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 422
diff changeset
107 const SDL_Color& getColorKey() const;
640
855ad500f991 * Added the ability to set/get the video driver used using the settings interface. Note that the default driver for the OS will be used unless explicitly specified.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 639
diff changeset
108 void setVideoDriver(const std::string& driver);
855ad500f991 * Added the ability to set/get the video driver used using the settings interface. Note that the default driver for the OS will be used unless explicitly specified.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 639
diff changeset
109 const std::string& getVideoDriver() const;
661
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 654
diff changeset
110 void setLightingModel(unsigned int lighting);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 654
diff changeset
111 unsigned int getLightingModel() const;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
112
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
113 private:
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
114 EngineSettings();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
115 };
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
116
654
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
117 %feature("director") IEngineChangeListener;
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
118 class IEngineChangeListener {
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
119 public:
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
120 virtual ~IEngineChangeListener() {}
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
121 virtual void onScreenModeChanged(const ScreenMode& newmode) = 0;
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
122 };
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
123
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
124 class Engine {
694
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
125 %rename(c_registerPreRenderCallback) registerPreRenderCallback(Callback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
126 %rename(c_registerPostRenderCallback) registerPostRenderCallback(Callback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
127 %rename(registerPreRenderCallback) py_registerPreRenderCallback(PyObject*);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
128 %rename(registerPostRenderCallback) py_registerPostRenderCallback(
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
129 PyObject*);
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
130 public:
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
131 Engine();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
132 virtual ~Engine();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
133 void initializePumping();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
134 void finalizePumping();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
135 void pump();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
136
694
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
137 %extend {
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
138 void py_registerPreRenderCallback(PyObject *callback)
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
139 {
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
140 Py_XDECREF(prerender_callback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
141 Py_XINCREF(callback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
142 prerender_callback = callback;
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
143 $self->registerPreRenderCallback(&preRenderCallback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
144 }
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
145
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
146 void py_registerPostRenderCallback(PyObject *callback)
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
147 {
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
148 Py_XDECREF(postrender_callback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
149 Py_XINCREF(callback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
150 postrender_callback = callback;
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
151 $self->registerPostRenderCallback(&postRenderCallback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
152 }
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
153 }
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
154 void registerPreRenderCallback(Callback callback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
155 void registerPostRenderCallback(Callback callback);
ca1fcb96907d Added pre- and post-rendering hooks for executing custom rendering code.
M. George Hansen <technopolitica@gmail.com>
parents: 661
diff changeset
156
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
157 EngineSettings& getSettings();
642
6e2151325017 * Added the ability to query the current running screen mode
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 640
diff changeset
158 const DeviceCaps& getDeviceCaps() const;
635
3094988564d5 * Added a simple method to query the default video card capabilities. This is still a work in progress. You can now get a list of ScreenModes the device supports. ScreenMode includes information on the screen resolution, if the mode is fullscreen/windowed and if it would use the OpenGL or SDL renderer.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 632
diff changeset
159
654
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
160 Image* changeScreenMode(const ScreenMode& mode);
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
161
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
162 void init();
144
d2f1e81fbe2c * Fixed a scons issue, where libraries checked for C instead of C++
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 112
diff changeset
163 void destroy();
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
164
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
165 SoundManager* getSoundManager();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
166 EventManager* getEventManager();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
167 TimeManager* getTimeManager();
697
ecaa4d98f05f Abstracted the GUI code and refactored the GUIChan-specific code into its own module.
M. George Hansen <technopolitica@gmail.com>
parents: 694
diff changeset
168 GuiManager* getGuiManager();
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
169 ImagePool* getImagePool();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
170 AnimationPool* getAnimationPool();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
171 SoundClipPool* getSoundClipPool();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
172 RenderBackend* getRenderBackend();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
173 Model* getModel();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
174 LogManager* getLogManager();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
175 GuiFont* getDefaultFont();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
176 VFS* getVFS();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
177 Cursor* getCursor();
654
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
178
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
179 void addChangeListener(IEngineChangeListener* listener);
5d6b1820b953 * Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 653
diff changeset
180 void removeChangeListener(IEngineChangeListener* listener);
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
181 };
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
182 }