summaryrefslogtreecommitdiffstats
path: root/src/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/engine/engine.cpp2
-rw-r--r--src/graphics/opengl/gldevice.cpp10
2 files changed, 4 insertions, 8 deletions
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 9216fb0..e0861d2 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -428,7 +428,7 @@ bool CEngine::WriteScreenShot(const std::string& fileName, int width, int height
CImage img({width,height});
img.SetDataPixels(pixels);
- img.flipVertical();
+ img.flipVertically();
if ( img.SavePNG(fileName.c_str()) ){
GetLogger()->Info("Save SceenShot Saved Successfully!\n");
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index 57738a6..b42f29d 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -1793,17 +1793,13 @@ FillMode CGLDevice::GetFillMode()
void* CGLDevice::GetFrameBufferPixels()const{
- SDL_Surface* surface = SDL_GetVideoSurface();
-
- assert(surface != nullptr);
-
- GLubyte* pixels = new GLubyte [4 * surface->h * surface->w];
+ GLubyte* pixels = new GLubyte [4 * m_config.size.x * m_config.size.y];
- glReadPixels(0,0,surface->w,surface->h,GL_RGBA,GL_UNSIGNED_BYTE,pixels);
+ 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 < surface->h * surface->w; ++i)
+ for (int i = 0; i < m_config.size.x * m_config.size.y; ++i)
p[i] |= 0xFF000000;
return static_cast<void*>(p);