commit d64c1acc695f024b61fb3964f40bbc9d22454308
parent 07e8cee9256e39b3003bc9cbc879ed2c0bbc35b0
Author: falkTX <falktx@falktx.com>
Date: Fri, 17 Sep 2021 20:11:20 +0100
Fix tests
Diffstat:
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dgl/src/OpenGL.cpp b/dgl/src/OpenGL.cpp
@@ -681,8 +681,10 @@ void Window::PrivateData::renderToPicture(const char* const filename,
glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels);
fprintf(f, "P3\n%d %d\n255\n", width, height);
- for (uint y = 0; y < height; y++) {
- for (uint i, x = 0; x < width; x++) {
+ for (uint y = 0; y < height; y++)
+ {
+ for (uint i, x = 0; x < width; x++)
+ {
i = 3 * ((height - y - 1) * width + x);
fprintf(f, "%3d %3d %3d ", pixels[i], pixels[i+1], pixels[i+2]);
}
diff --git a/dgl/src/WindowPrivateData.cpp b/dgl/src/WindowPrivateData.cpp
@@ -748,7 +748,6 @@ void Window::PrivateData::onPuglExpose()
if (widget->isVisible())
widget->pData->display();
}
-#endif
if (char* const filename = filenameToRenderInto)
{
@@ -757,6 +756,7 @@ void Window::PrivateData::onPuglExpose()
renderToPicture(filename, getGraphicsContext(), static_cast<uint>(rect.width), static_cast<uint>(rect.height));
std::free(filename);
}
+#endif
}
void Window::PrivateData::onPuglClose()