summaryrefslogtreecommitdiffstats
path: root/src/graphics/opengl/gldevice.cpp
diff options
context:
space:
mode:
authorPiotr Dziwiński <piotrdz@gmail.com>2014-06-24 19:42:25 +0200
committerPiotr Dziwiński <piotrdz@gmail.com>2014-06-24 19:42:25 +0200
commitae13e0a62121d7fc8fa5ec5769ea5e7125443146 (patch)
treee2d5883e04bd01342f51d6457a130d663fc5eafd /src/graphics/opengl/gldevice.cpp
parent52cf9e2815688481f689e03e67c5fc983ed1351b (diff)
parentf5ba2a27d4422401317d814c60048121f9804429 (diff)
downloadcolobot-ae13e0a62121d7fc8fa5ec5769ea5e7125443146.tar.gz
colobot-ae13e0a62121d7fc8fa5ec5769ea5e7125443146.tar.bz2
colobot-ae13e0a62121d7fc8fa5ec5769ea5e7125443146.zip
Merge pull request #304 from MohamedWaheed/dev
Savefile screenshot implementation and screenshot loading bug fix
Diffstat (limited to 'src/graphics/opengl/gldevice.cpp')
-rw-r--r--src/graphics/opengl/gldevice.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index 9f64fab..b42f29d 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -1791,6 +1791,19 @@ FillMode CGLDevice::GetFillMode()
return FILL_POINT;
}
+void* CGLDevice::GetFrameBufferPixels()const{
+
+ GLubyte* pixels = new GLubyte [4 * m_config.size.x * m_config.size.y];
+
+ glReadPixels(0, 0, m_config.size.x, m_config.size.y, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+
+ unsigned int* p = static_cast<unsigned int*> ( static_cast<void*>(pixels) );
+
+ for (int i = 0; i < m_config.size.x * m_config.size.y; ++i)
+ p[i] |= 0xFF000000;
+
+ return static_cast<void*>(p);
+}
} // namespace Gfx