Fix test common save image function
Some checks failed
Make PNG / build-app (push) Failing after 33s
Some checks failed
Make PNG / build-app (push) Failing after 33s
This commit is contained in:
parent
b8e616c8d6
commit
263cf68ca2
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
build/
|
build/
|
||||||
cmake-build-*/
|
cmake-build-*/
|
||||||
.idea/
|
.idea/
|
||||||
|
.cache/
|
||||||
|
@ -8,18 +8,18 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
unsigned char pixels[(GRID_WIDTH * 8) * (GRID_HEIGHT * 8) * 3];
|
unsigned char pixels[(GRID_WIDTH * CELL_SIZE * CELL_SCALE) * (GRID_HEIGHT * CELL_SIZE * CELL_SCALE) * 3];
|
||||||
}
|
}
|
||||||
|
|
||||||
void glerminal_test_save_image()
|
void glerminal_test_save_image()
|
||||||
{
|
{
|
||||||
// -- DIRTY HACK --
|
// -- DIRTY HACK --
|
||||||
//
|
//
|
||||||
// GL_TEXTURE_2D is not rebound after setting up screen framebuffer
|
// GL_TEXTURE_2D is not rebound after setting up screen framebuffer
|
||||||
// This code will break if this behavior changes
|
// This code will break if this behavior changes
|
||||||
|
|
||||||
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels);
|
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
stbi_flip_vertically_on_write(true);
|
stbi_flip_vertically_on_write(true);
|
||||||
stbi_write_png("image.png", GRID_WIDTH * 8, GRID_HEIGHT * 8, 3, pixels, GRID_WIDTH * 8 * 3);
|
stbi_write_png("image.png", GRID_WIDTH * CELL_SIZE * CELL_SCALE, GRID_HEIGHT * CELL_SIZE * CELL_SCALE, 3, pixels, GRID_WIDTH * CELL_SIZE * CELL_SCALE * 3);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user