summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-07-29 15:09:53 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-07-29 15:09:53 +0200
commit7c5a3514dd6e907866bddcbb09b4d9cbd958dd8e (patch)
tree00aaece75d43bd35a3997bf4eacdfd103d29d5c7 /src/graphics/engine
parent72c0188ec37c3783133baf6960d72cb3c9d12a6c (diff)
downloadcolobot-7c5a3514dd6e907866bddcbb09b4d9cbd958dd8e.tar.gz
colobot-7c5a3514dd6e907866bddcbb09b4d9cbd958dd8e.tar.bz2
colobot-7c5a3514dd6e907866bddcbb09b4d9cbd958dd8e.zip
Video mode changing
- added video mode querying & changing - added joystick querying & changing - cleaned up CApplication interface
Diffstat (limited to 'src/graphics/engine')
-rw-r--r--src/graphics/engine/engine.cpp20
-rw-r--r--src/graphics/engine/engine.h21
2 files changed, 36 insertions, 5 deletions
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 0914f9e..e544ee3 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -62,9 +62,6 @@ Gfx::CEngine::CEngine(CInstanceManager *iMan, CApplication *app)
m_sound = NULL;
m_terrain = NULL;
- m_dim.x = 640;
- m_dim.y = 480;
- m_lastDim = m_dim;
m_focus = 0.75f;
m_baseTime = 0;
m_lastTime = 0;
@@ -272,6 +269,12 @@ bool Gfx::CEngine::AfterDeviceSetInit()
return true;
}
+void Gfx::CEngine::ResetAfterDeviceChanged()
+{
+ // TODO
+}
+
+
Gfx::Texture Gfx::CEngine::CreateTexture(const std::string &texName, const Gfx::TextureCreateParams &params)
{
CImage img;
@@ -727,3 +730,14 @@ void Gfx::CEngine::AddStatisticTriangle(int count)
{
m_statisticTriangle += count;
}
+
+void Gfx::CEngine::SetShowStat(bool show)
+{
+ m_showStats = show;
+}
+
+bool Gfx::CEngine::GetShowStat()
+{
+ return m_showStats;
+}
+
diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h
index 1348cdd..25c5e5d 100644
--- a/src/graphics/engine/engine.h
+++ b/src/graphics/engine/engine.h
@@ -26,6 +26,7 @@
#include "graphics/core/texture.h"
#include "graphics/core/vertex.h"
#include "math/intpoint.h"
+#include "math/intsize.h"
#include "math/matrix.h"
#include "math/point.h"
#include "math/vector.h"
@@ -513,21 +514,33 @@ public:
CEngine(CInstanceManager *iMan, CApplication *app);
~CEngine();
+ //! Returns whether the device was initialized
bool GetWasInit();
+ //! Returns the last error encountered
std::string GetError();
+ //! Performs the first initialization, before a device was set
bool Create();
+ //! Frees all resources before exit
void Destroy();
+ //! Sets the device to be used
void SetDevice(Gfx::CDevice *device);
+ //! Returns the current device
Gfx::CDevice* GetDevice();
+ //! Performs initialization after a device was created and set
bool AfterDeviceSetInit();
+ //! Resets some states and flushes textures after device was changed (e.g. resoulution changed)
+ void ResetAfterDeviceChanged();
+
void SetTerrain(Gfx::CTerrain* terrain);
+ //! Processes incoming event
bool ProcessEvent(const Event &event);
+ //! Renders a single frame
bool Render();
@@ -859,6 +872,9 @@ protected:
bool m_wasInit;
std::string m_error;
+ //! Whether to show stats (FPS, etc)
+ bool m_showStats;
+
int m_blackSrcBlend[2];
int m_blackDestBlend[2];
int m_whiteSrcBlend[2];
@@ -887,8 +903,9 @@ protected:
bool m_render;
bool m_movieLock;
- Math::IntPoint m_dim;
- Math::IntPoint m_lastDim;
+ //! Current size of window
+ Math::IntSize m_size;
+ Math::IntSize m_lastSize;
std::vector<Gfx::EngineObjLevel1> m_objectTree;
std::vector<Gfx::EngineObject> m_objects;