diff options
author | adiblol <adiblol@hydrogen> | 2012-09-30 03:18:11 +0200 |
---|---|---|
committer | adiblol <adiblol@hydrogen> | 2012-09-30 03:18:11 +0200 |
commit | 923616ccac5d84184a70ac4bd10ff35322802c8c (patch) | |
tree | c6bb91cc1839810c351c0739658ef10eba0181f7 /src/graphics | |
parent | c36d0c8ed24775babd875e5f1ff7083e85fb2191 (diff) | |
download | colobot-923616ccac5d84184a70ac4bd10ff35322802c8c.tar.gz colobot-923616ccac5d84184a70ac4bd10ff35322802c8c.tar.bz2 colobot-923616ccac5d84184a70ac4bd10ff35322802c8c.zip |
Dirty hack to allow window resizing or even full screen.
Currently makes text buggy!
(full screen must be initiated by window manager, for example Alt+F11 in Fluxbox)
Diffstat (limited to 'src/graphics')
-rw-r--r-- | src/graphics/core/device.h | 2 | ||||
-rw-r--r-- | src/graphics/opengl/gldevice.cpp | 7 | ||||
-rw-r--r-- | src/graphics/opengl/gldevice.h | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/graphics/core/device.h b/src/graphics/core/device.h index 0777396..bd56ea3 100644 --- a/src/graphics/core/device.h +++ b/src/graphics/core/device.h @@ -72,7 +72,7 @@ struct DeviceConfig size = Math::IntPoint(800, 600); bpp = 32; fullScreen = false; - resizeable = false; + resizeable = true; doubleBuf = true; noFrame = false; } diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp index 78a77bd..c1c129a 100644 --- a/src/graphics/opengl/gldevice.cpp +++ b/src/graphics/opengl/gldevice.cpp @@ -170,6 +170,13 @@ void CGLDevice::ConfigChanged(const GLDeviceConfig& newConfig) Create(); } +void CGLDevice::ResizeViewport(const unsigned int width, const unsigned int height) +{ + m_config.size.x = width; + m_config.size.y = height; + glViewport(0, 0, m_config.size.x, m_config.size.y); +} + void CGLDevice::BeginScene() { Clear(); diff --git a/src/graphics/opengl/gldevice.h b/src/graphics/opengl/gldevice.h index 8af864e..2f9b9d8 100644 --- a/src/graphics/opengl/gldevice.h +++ b/src/graphics/opengl/gldevice.h @@ -86,6 +86,7 @@ public: virtual void BeginScene(); virtual void EndScene(); + virtual void ResizeViewport(const unsigned int width, const unsigned int height); virtual void Clear(); |