Browse Source

Fix tests

pull/327/head
falkTX 4 years ago
parent
commit
d64c1acc69
2 changed files with 5 additions and 3 deletions
  1. +4
    -2
      dgl/src/OpenGL.cpp
  2. +1
    -1
      dgl/src/WindowPrivateData.cpp

+ 4
- 2
dgl/src/OpenGL.cpp View File

@@ -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]);
}


+ 1
- 1
dgl/src/WindowPrivateData.cpp View File

@@ -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()


Loading…
Cancel
Save