Setup basic testing framework

This commit is contained in:
Shylie
2024-05-25 23:16:23 -04:00
parent b2164b76cf
commit b4427a0c88
12 changed files with 1869 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
#include <test-common.h>
#include <glerminal.h>
#include <glad/glad.h>
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include <stb_image_write.h>
namespace
{
unsigned char pixels[1280 * 800 * 3];
}
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);
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);
}

View File

@@ -0,0 +1,6 @@
#ifndef GLERMINAL_TEST_COMMON_H
#define GLERMINAL_TEST_COMMON_H
void glerminal_test_save_image();
#endif//GLERMINAL_TEST_COMMON_H