aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-02-15 08:51:42 -0500
committerClyne Sullivan <tullivan99@gmail.com>2017-02-15 08:51:42 -0500
commit4a5d0a99f7c83c9f254cbfb8f41828831f8251db (patch)
tree26f2c99558586a1efd59640ba67ebccce5d2be46 /src/window.cpp
parent29876964587eda6e4d4bfc6543ea31efe983cf0a (diff)
screenshots, arena door
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 049ee69..7d8f8e7 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -97,14 +97,10 @@ void WindowSystem::render(void)
if (doScreenshot.load()) {
doScreenshot.store(false);
// Make the BYTE array, factor of 3 because it's RBG.
- static GLubyte* pixels;
int count = 3 * game::SCREEN_WIDTH * game::SCREEN_HEIGHT;
- pixels = new GLubyte[count];
- glReadPixels(0, 0, game::SCREEN_WIDTH, game::SCREEN_HEIGHT, GL_RGB, GL_UNSIGNED_BYTE, pixels);
- //for(int i = 0; i < count; i++)
- // pixels[i] = 255;
+ GLubyte* pixels = new GLubyte[count];
+ glReadPixels(0, 0, game::SCREEN_WIDTH, game::SCREEN_HEIGHT, GL_BGR, GL_UNSIGNED_BYTE, pixels);
ui::takeScreenshot(pixels);
- std::cout << "Triggered\n";
}
SDL_GL_SwapWindow(window);