summaryrefslogtreecommitdiffstats
path: root/src/app/app.h
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-20 20:37:37 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-20 20:37:37 +0200
commitbd36d76b31b27255c73376cda7f844e2eba7af82 (patch)
tree465e4f2c684bdd8bc8a5cbfddb2f2bd326f5bf4b /src/app/app.h
parent7b6bbf79c4bb73013e2fe01f84f0025e7c06c00e (diff)
downloadcolobot-bd36d76b31b27255c73376cda7f844e2eba7af82.tar.gz
colobot-bd36d76b31b27255c73376cda7f844e2eba7af82.tar.bz2
colobot-bd36d76b31b27255c73376cda7f844e2eba7af82.zip
Mouse pos setting, low cpu mode, stats display
Diffstat (limited to 'src/app/app.h')
-rw-r--r--src/app/app.h46
1 files changed, 36 insertions, 10 deletions
diff --git a/src/app/app.h b/src/app/app.h
index 33be5a5..03199aa 100644
--- a/src/app/app.h
+++ b/src/app/app.h
@@ -22,12 +22,15 @@
#pragma once
+
#include "common/global.h"
#include "common/singleton.h"
+
#include "graphics/core/device.h"
#include "graphics/engine/engine.h"
#include "graphics/opengl/gldevice.h"
+
#include <string>
#include <vector>
@@ -98,6 +101,18 @@ enum ParseArgsStatus
PARSE_ARGS_HELP = 3 //! < -help requested
};
+/**
+ * \enum MouseMode
+ * \brief Mode of mouse cursor
+ */
+enum MouseMode
+{
+ MOUSE_SYSTEM, //! < system cursor visible; in-game cursor hidden
+ MOUSE_ENGINE, //! < in-game cursor visible; system cursor hidden
+ MOUSE_BOTH, //! < both cursors visible (only for debug)
+ MOUSE_NONE, //! < no cursor visible
+};
+
struct ApplicationPrivate;
/**
@@ -250,17 +265,17 @@ public:
bool GetGrabInput();
//@}
- //! Management of the visiblity of system mouse cursor
+ //! Management of mouse mode
//@{
- void SetSystemMouseVisible(bool visible);
- bool GetSystemMouseVisibile();
+ void SetMouseMode(MouseMode mode);
+ MouseMode GetMouseMode();
//@}
- //! Management of the position of system mouse cursor (in interface coords)
- //@{
- void SetSystemMousePos(Math::Point pos);
- Math::Point GetSystemMousePos();
- //@}
+ //! Returns the position of mouse cursor (in interface coords)
+ Math::Point GetMousePos();
+
+ //! Moves (warps) the mouse cursor to the specified position (in interface coords)
+ void MoveMouse(Math::Point pos);
//! Management of debug mode (prints more info in logger)
//@{
@@ -277,6 +292,12 @@ public:
void SetLanguage(Language language);
//@}
+ //! Management of sleep in main loop (lowers CPU usage)
+ //@{
+ void SetLowCPU(bool low);
+ bool GetLowCPU();
+ //@}
+
protected:
//! Creates the window's SDL_Surface
bool CreateVideoSurface();
@@ -357,8 +378,10 @@ protected:
//! Current state of mouse buttons (mask of button indexes)
unsigned int m_mouseButtonsState;
- //! Current system mouse position
- Math::Point m_systemMousePos;
+ //! Current mode of mouse
+ MouseMode m_mouseMode;
+ //! Current position of mouse cursor
+ Math::Point m_mousePos;
//! Info about current joystick device
JoystickDevice m_joystick;
@@ -374,5 +397,8 @@ protected:
//! Application language
Language m_language;
+
+ //! Low cpu mode
+ bool m_lowCPU;
};