Saga3D API Documentation  1.0-RC4
SagaDevice.h
Go to the documentation of this file.
1 #ifndef __SAGA_DEVICE_H_INCLUDED__
2 #define __SAGA_DEVICE_H_INCLUDED__
3 
4 #include "EDriverTypes.h"
5 #include "EDeviceTypes.h"
6 #include <glm/vec2.hpp>
7 #include <cstdint>
8 #include <string>
9 #include <memory>
10 
11 namespace saga
12 {
13  class IEventReceiver;
14  class IRandomizer;
15 
16  namespace io {
17  class IFileSystem;
18  } // namespace io
19 
20  namespace scene {
21  class ISceneManager;
22  } // namespace scene
23 
24  namespace video {
25  enum class E_PIXEL_FORMAT;
26  class IVideoDriver;
27  } // namespace video
28 
30 
35  class SagaDevice
36  {
37  public:
38 
39  virtual ~SagaDevice() {}
40 
42 
66  virtual bool run() = 0;
67 
69 
71  virtual void yield() = 0;
72 
74 
77  virtual void sleep(std::uint32_t timeMs) = 0;
78 
80 
81  virtual std::uint32_t getTime() const = 0;
82 
84 
85  virtual const std::shared_ptr<video::IVideoDriver>& getVideoDriver() const = 0;
86 
88 
89  virtual const std::shared_ptr<scene::ISceneManager>& getSceneManager() const = 0;
90 
92 
95  virtual void addEventReceiver(IEventReceiver* receiver) = 0;
96 
98 
99  virtual void setWindowCaption(const std::string& text) = 0;
100 
102 
117  virtual bool isWindowActive() const = 0;
118 
120 
121  virtual bool isWindowFocused() const = 0;
122 
124 
125  virtual bool isWindowMinimized() const = 0;
126 
128 
129  virtual bool isFullscreen() const = 0;
130 
132 
133  virtual void closeDevice() = 0;
134 
136 
139  virtual void setResizable(bool resize=false) = 0;
140 
142  virtual std::uint32_t getWidth() const = 0;
143 
145  virtual std::uint32_t getHeight() const = 0;
146 
148  virtual float getAspectRatio() const = 0;
149 
151 
155  virtual void setWindowSize(const glm::uvec2& size) = 0;
156 
158  virtual void minimizeWindow() = 0;
159 
161  virtual void maximizeWindow() = 0;
162 
164  virtual void restoreWindow() = 0;
165 
167  virtual glm::ivec2 getWindowPosition() = 0;
168  };
169 
170 } // namespace saga
171 
172 #endif // __SAGA_DEVICE_H_INCLUDED__
saga::SagaDevice::getWindowPosition
virtual glm::ivec2 getWindowPosition()=0
Get the position of the frame on-screen.
saga::SagaDevice::setResizable
virtual void setResizable(bool resize=false)=0
Sets if the window should be resizable in windowed mode.
saga::SagaDevice::getSceneManager
virtual const std::shared_ptr< scene::ISceneManager > & getSceneManager() const =0
Provides access to the scene manager.
EDeviceTypes.h
saga::SagaDevice::getTime
virtual std::uint32_t getTime() const =0
Returns time elapsed in milliseconds since initialization.
saga::SagaDevice::maximizeWindow
virtual void maximizeWindow()=0
Maximizes the window if possible.
saga::SagaDevice::run
virtual bool run()=0
Runs the device.
saga::SagaDevice::~SagaDevice
virtual ~SagaDevice()
Definition: SagaDevice.h:39
saga::SagaDevice::sleep
virtual void sleep(std::uint32_t timeMs)=0
Pause execution and let other processes to run for a specified amount of time.
saga::SagaDevice::closeDevice
virtual void closeDevice()=0
Notifies the device that it should close itself.
saga::SagaDevice::restoreWindow
virtual void restoreWindow()=0
Restore the window to normal size if possible.
saga::SagaDevice::getAspectRatio
virtual float getAspectRatio() const =0
Get aspect ratio.
saga::IEventReceiver
Interface of an object which can receive events (SDL_Event*)
Definition: IEventReceiver.h:17
saga::SagaDevice::addEventReceiver
virtual void addEventReceiver(IEventReceiver *receiver)=0
Register your event listener, which receives SDL_Event.
saga::SagaDevice::getVideoDriver
virtual const std::shared_ptr< video::IVideoDriver > & getVideoDriver() const =0
Provides access to the video driver for drawing 3d and 2d geometry.
saga::SagaDevice::setWindowSize
virtual void setWindowSize(const glm::uvec2 &size)=0
Resize the render window.
saga::SagaDevice::isWindowMinimized
virtual bool isWindowMinimized() const =0
Checks if the Irrlicht window is minimized.
saga::SagaDevice::getWidth
virtual std::uint32_t getWidth() const =0
Get window's width.
saga::SagaDevice::isFullscreen
virtual bool isFullscreen() const =0
Checks if the Irrlicht window is running in fullscreen mode.
saga::SagaDevice::isWindowActive
virtual bool isWindowActive() const =0
Returns if the window is active.
saga::video::E_PIXEL_FORMAT
E_PIXEL_FORMAT
Enumeration for all primitive types there are.
Definition: EPixelFormat.h:10
saga::SagaDevice
The Irrlicht device. You can create it with createDevice() or createDeviceEx().
Definition: SagaDevice.h:35
saga::SagaDevice::isWindowFocused
virtual bool isWindowFocused() const =0
Checks if the Irrlicht window has focus.
saga::SagaDevice::minimizeWindow
virtual void minimizeWindow()=0
Minimizes the window if possible.
saga::SagaDevice::getHeight
virtual std::uint32_t getHeight() const =0
Get window's height.
saga::SagaDevice::yield
virtual void yield()=0
Cause the device to temporarily pause execution for 500ms and let other processes run.
saga
Definition: aabbox3d.h:11
saga::SagaDevice::setWindowCaption
virtual void setWindowCaption(const std::string &text)=0
Sets the caption of the window.
EDriverTypes.h