mirror of
https://git.shylie.info/shylie/glerminal.git
synced 2025-10-02 13:10:10 +00:00
Rework testing code
This commit is contained in:
@@ -13,8 +13,12 @@ namespace
|
||||
|
||||
void glerminal_test_save_image()
|
||||
{
|
||||
glReadBuffer(GL_LEFT);
|
||||
glReadPixels(0, 0, GRID_WIDTH * CELL_SCALE * 8, GRID_HEIGHT * CELL_SCALE * 8, GL_RGB, GL_UNSIGNED_BYTE, pixels);
|
||||
// -- DIRTY HACK --
|
||||
//
|
||||
// GL_TEXTURE_2D is not rebound after setting up screen framebuffer
|
||||
// This code will break if this behavior changes
|
||||
|
||||
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels);
|
||||
|
||||
stbi_flip_vertically_on_write(true);
|
||||
stbi_write_png("image.png", GRID_WIDTH * CELL_SCALE * 8, GRID_HEIGHT * CELL_SCALE * 8, 3, pixels, 1280 * 3);
|
||||
|
Reference in New Issue
Block a user