mirror of
https://git.shylie.info/shylie/glerminal.git
synced 2024-12-22 14:40:05 +00:00
Fix image size/stride error in test program
This commit is contained in:
parent
1a1f4e8b13
commit
7c0c02b9af
@ -15,7 +15,7 @@ namespace
|
|||||||
|
|
||||||
for (int i = 0; i < GRID_HEIGHT; i++)
|
for (int i = 0; i < GRID_HEIGHT; i++)
|
||||||
{
|
{
|
||||||
glerminal_set(i + 1, i + 1, 0, 1);
|
glerminal_set(i, i, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
glerminal_flush();
|
glerminal_flush();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
unsigned char pixels[(GRID_WIDTH * CELL_SCALE * 8) * (GRID_HEIGHT * CELL_SCALE * 8) * 3];
|
unsigned char pixels[(GRID_WIDTH * 8) * (GRID_HEIGHT * 8) * 3];
|
||||||
}
|
}
|
||||||
|
|
||||||
void glerminal_test_save_image()
|
void glerminal_test_save_image()
|
||||||
@ -21,5 +21,5 @@ void glerminal_test_save_image()
|
|||||||
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 * CELL_SCALE * 8, GRID_HEIGHT * CELL_SCALE * 8, 3, pixels, GRID_WIDTH * CELL_SCALE * 8 * 3);
|
stbi_write_png("image.png", GRID_WIDTH * 8, GRID_HEIGHT * 8, 3, pixels, GRID_WIDTH * 8 * 3);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user