69 : index(-1), axisCount(0), buttonCount(0) {}
113 PCNT_EVENT_PROCESSING,
135 DEBUG_SYS_EVENTS = 1 << 0,
136 DEBUG_APP_EVENTS = 1 << 1,
137 DEBUG_EVENTS = DEBUG_SYS_EVENTS | DEBUG_APP_EVENTS,
138 DEBUG_MODELS = 1 << 2,
139 DEBUG_ALL = DEBUG_SYS_EVENTS | DEBUG_APP_EVENTS | DEBUG_MODELS
223 bool fullScreen,
bool resizeable)
const;
244 float GetSimulationSpeed()
const;
275 bool GetJoystickEnabled()
const;
287 bool GetGrabInput()
const;
302 bool IsDebugModeActive(DebugMode mode)
const;
303 static bool ParseDebugModes(
const std::string& str,
int& debugModes);
309 char GetLanguageChar()
const;
310 void SetLanguage(
Language language);
311 static bool ParseLanguage(
const std::string& str,
Language& language);
317 bool GetLowCPU()
const;
327 bool GetSceneTestMode();
411 float m_performanceCountersData[
PCNT_MAX];
413 long long m_realAbsTimeBase;
414 long long m_realAbsTime;
415 long long m_realRelTime;
417 long long m_absTimeBase;
418 long long m_exactAbsTime;
419 long long m_exactRelTime;
424 float m_simulationSpeed;
425 bool m_simulationSuspended;
~CApplication()
Destructor.
Definition: app.cpp:171
bool m_restart
If we are restarting the app.
Definition: app.h:391
CSoundInterface * GetSound()
Returns the sound subsystem.
Definition: app.cpp:210
CEventQueue * m_eventQueue
Global event queue.
Definition: app.h:366
Additional config with OpenGL-specific settings.
Definition: glutil.h:48
CSingleton base class for singletons.
std::string m_runSceneName
Scene to run on startup.
Definition: app.h:445
void Render()
Renders the image in window.
Definition: app.cpp:1268
< frame update in CParticle
Definition: app.h:118
ParseArgsStatus ParseArguments(int argc, char *argv[])
Parses commandline arguments.
Definition: app.cpp:215
std::string m_windowTitle
Text set as window title.
Definition: app.h:402
ParseArgsStatus
State of parsing commandline arguments.
Definition: app.h:88
Main graphics engine - CEngine class.
void CloseJoystick()
Closes the joystick device.
Definition: app.cpp:805
< rendering shadow map
Definition: app.h:128
Class for managing data/lang/save paths, and something% replacements.
Definition: pathman.h:35
const std::string & GetErrorMessage() const
Returns the message of error (set to something if exit code is not 0)
Definition: app.cpp:1053
bool m_sceneTest
Scene test mode.
Definition: app.h:450
void SetJoystickEnabled(bool enable)
Management of joystick enable state.
Definition: app.cpp:1547
long long GetExactAbsTime() const
Returns the exact absolute time counter [nanoseconds].
Definition: app.cpp:1369
void SetSimulationSpeed(float speed)
Management of simulation speed.
Definition: app.cpp:1310
bool m_resolutionOverride
Screen resoultion overriden by commandline.
Definition: app.h:459
< rendering the water
Definition: app.h:123
CEventQueue * GetEventQueue()
Returns the application's event queue.
Definition: app.cpp:205
std::vector< bool > m_joyButtonState
Current state of joystick buttons; may be updated from another thread.
Definition: app.h:441
void SetMouseMode(MouseMode mode)
Management of mouse mode.
Definition: app.cpp:1504
< all ok
Definition: app.h:91
< all counters together
Definition: app.h:130
void Restart()
Restart.
Definition: app.cpp:717
ApplicationPrivate * m_private
Private (SDL-dependent data)
Definition: app.h:359
std::vector< int > m_joyAxeState
Current state of joystick axes; may be updated from another thread.
Definition: app.h:439
VideoQueryResult GetVideoResolutionList(std::vector< Math::IntPoint > &resolutions, bool fullScreen, bool resizeable) const
Returns a list of possible video modes.
Definition: app.cpp:1399
CController * m_controller
Game controller - game engine and UI.
Definition: app.h:376
< invalid syntax
Definition: app.h:92
< the whole frame update process
Definition: app.h:116
< in-game cursor visible; system cursor hidden
Definition: app.h:103
void ResetTimeAfterLoading()
Resets time counters to account for time spent loading game.
Definition: app.cpp:1290
Definition: singleton.h:30
int index
Device index (-1 = invalid device)
Definition: app.h:60
bool GetSimulationSuspended() const
Returns whether simulation is suspended.
Definition: app.cpp:1305
void InternalResumeSimulation()
Internal procedure to reset time counters.
Definition: app.cpp:1297
CInput * m_input
Input manager.
Definition: app.h:380
Some common, global definitions.
std::string m_graphics
Graphics device to use.
Definition: app.h:429
void LogEvent(const Event &event)
Logs debug data for event.
Definition: app.cpp:1168
bool ChangeJoystick(const JoystickDevice &newJoystick)
Change the current joystick device.
Definition: app.cpp:813
Gfx::CEngine * m_engine
Graphics engine.
Definition: app.h:368
CProfile * m_profile
Profile (INI) reader/writer.
Definition: app.h:378
long long GetExactRelTime() const
Returns the exact realative time since last update [nanoseconds].
Definition: app.cpp:1384
std::string name
Device name.
Definition: app.h:62
bool CreateVideoSurface()
Creates the window's SDL_Surface.
Definition: app.cpp:620
Global event queue.
Definition: event.h:751
Gfx::CDevice * m_device
Graphics device.
Definition: app.h:370
int axisCount
Number of axes (only available after joystick opened)
Definition: app.h:64
Gfx::CModelManager * m_modelManager
3D models manager
Definition: app.h:372
SystemTimeStamp * m_baseTimeStamp
Animation time stamps, etc.
Definition: app.h:406
void SetLowCPU(bool low)
Management of sleep in main loop (lowers CPU usage)
Definition: app.cpp:1752
TEST_VIRTUAL Event CreateUpdateEvent()
Prepares a simulation update event.
Definition: app.cpp:1321
void UpdateJoystick()
Polls the state of joystick axes and buttons.
Definition: app.cpp:837
CSoundInterface * m_sound
Sound subsystem.
Definition: app.h:374
bool m_lowCPU
Low cpu mode.
Definition: app.h:456
PerformanceCounter
Type of counter testing performance.
Definition: app.h:111
bool ChangeVideoConfig(const Gfx::GLDeviceConfig &newConfig)
Change the video mode to given mode.
Definition: app.cpp:728
< rendering 2D interface
Definition: app.h:126
long m_debugModes
Bit array of active debug modes.
Definition: app.h:389
void MoveMouse(Math::Point pos)
Moves (warps) the mouse cursor to the specified position (in interface coords)
Definition: app.cpp:1518
void UpdateMouse()
Updates the mouse position explicitly.
Definition: app.cpp:891
void UpdatePerformanceCountersData()
Updates performance counters from gathered timer data.
Definition: app.cpp:1786
float GetAbsTime() const
Returns the absolute time counter [seconds].
Definition: app.cpp:1364
CApplication()
Constructor (can only be called once!)
Definition: app.cpp:105
< rendering the particles in 3D
Definition: app.h:122
bool IsRestarting()
Should we restart after app quits?
Definition: app.cpp:723
< rendering the terrain
Definition: app.h:124
CObjectManager * m_objMan
Object manager.
Definition: app.h:364
Gfx::GLDeviceConfig m_lastDeviceConfig
Previous configuration of OpenGL display device.
Definition: app.h:399
< frame update in CEngine
Definition: app.h:117
2D point
Definition: point.h:49
< both cursors visible (only for debug)
Definition: app.h:104
< the whole rendering process
Definition: app.h:121
bool Create()
Initializes the application.
Definition: app.cpp:427
long long GetRealRelTime() const
Returns the exact relative time since last update disregarding speed setting [nanoseconds].
Definition: app.cpp:1389
Main application.
Definition: app.h:187
Language m_language
Application language.
Definition: app.h:453
Gfx::GLDeviceConfig GetVideoConfig() const
Returns the current video mode.
Definition: app.cpp:1394
int m_exitCode
Code to return at exit.
Definition: app.h:385
Entry point into CRobotMain and CMainDialog.
Definition: controller.h:40
JoystickDevice GetJoystick() const
Returns info about the current joystick.
Definition: app.cpp:1542
OpenGL implementation - CGL21Device class.
float GetRelTime() const
Returns the relative time since last update [seconds].
Definition: app.cpp:1379
JoystickDevice m_joystick
Info about current joystick device.
Definition: app.h:435
Event CreateVirtualEvent(const Event &sourceEvent)
If applicable, creates a virtual event to match the changed state as of new event.
Definition: app.cpp:1232
bool m_joystickEnabled
Whether joystick is enabled.
Definition: app.h:437
Namespace for (new) graphics code.
Definition: app.h:49
Class for loading profile (currently for loading ini config file)
Definition: profile.h:45
void SetDebugModeActive(DebugMode mode, bool active)
Management of debug modes (printing more info in logger)
Definition: app.cpp:1442
VideoQueryResult
Result of querying for available video resolutions.
Definition: app.h:76
< rendering the 3D objects
Definition: app.h:125
bool m_headless
Headles mode.
Definition: app.h:462
std::vector< JoystickDevice > GetJoystickList() const
Returns a list of available joystick devices.
Definition: app.cpp:1525
Manager for static models.
Definition: modelmanager.h:54
The graphics engine.
Definition: engine.h:684
MouseMode m_mouseMode
Current mode of mouse.
Definition: app.h:432
bool m_active
Whether application window is active.
Definition: app.h:387
< event processing (except update events)
Definition: app.h:115
CPathManager * m_pathManager
Path manager.
Definition: app.h:382
Gfx::GLDeviceConfig m_deviceConfig
Current configuration of OpenGL display device.
Definition: app.h:397
Class for loading profile (currently for loading ini config file)
MouseMode
Mode of mouse cursor.
Definition: app.h:99
void SuspendSimulation()
Suspends animation (time will not be updated)
Definition: app.cpp:1276
Definition: system_linux.h:30
Abstract graphics device - CDevice class and related structs/enums.
Language GetLanguage() const
Management of language.
Definition: app.cpp:1569
CInstanceManager * m_iMan
Instance manager.
Definition: app.h:362
std::string m_errorMessage
Message to be displayed as error to the user.
Definition: app.h:394
void SetGrabInput(bool grab)
Management of the grab mode for input (keyboard & mouse)
Definition: app.cpp:1493
< system cursor visible; in-game cursor hidden
Definition: app.h:102
long long GetRealAbsTime() const
Returns the exact absolute time counter disregarding speed setting [nanoseconds]. ...
Definition: app.cpp:1374
< frame update in CRobotMain
Definition: app.h:120
Event sent by system, interface or game.
Definition: event.h:678
void ResumeSimulation()
Resumes animation.
Definition: app.cpp:1282
int GetExitCode() const
Returns the code to be returned at main() exit.
Definition: app.cpp:1048
bool OpenJoystick()
Opens the joystick device.
Definition: app.cpp:783
int buttonCount
Number of buttons (only available after joystick opened)
Definition: app.h:66
Language
Application language.
Definition: global.h:174
int Run()
Main event loop.
Definition: app.cpp:898
Manager for instances of certain classes.
Definition: iman.h:72
Event ProcessSystemEvent()
Processes the captured SDL event to Event struct.
Definition: app.cpp:1060
Private data of CApplication class.
Definition: app.cpp:80
Information about a joystick device.
Definition: app.h:57
void Destroy()
Cleans up before exit.
Definition: app.cpp:671
Sound plugin interface.
Definition: sound.h:151
Abstract interface of graphics device.
Definition: device.h:251
void ResetPerformanceCounters()
Resets all performance counters to zero.
Definition: app.cpp:1777
void StartPerformanceCounter(PerformanceCounter counter)
Management of performance counters.
Definition: app.cpp:1762