mirror of
https://git.shylie.info/shylie/glerminal.git
synced 2024-12-22 22:50:06 +00:00
Compare commits
19 Commits
65c6de85ba
...
96944fcaa9
Author | SHA1 | Date | |
---|---|---|---|
|
96944fcaa9 | ||
|
fc4c150965 | ||
|
526924d02a | ||
|
be6a31043a | ||
|
60117c5cf9 | ||
|
3d635b67f5 | ||
|
09d5acc983 | ||
|
c168e795a4 | ||
|
1261ae71db | ||
|
5997c95f0d | ||
|
e5edcd05b2 | ||
|
8fb977a4a1 | ||
|
4c03524fc5 | ||
|
e67bb9c017 | ||
|
853bec6df9 | ||
|
43b77a4ece | ||
|
c1e9b1d6bd | ||
|
374677349d | ||
|
d285983dea |
38
.gitea/workflows/make_png.yaml
Normal file
38
.gitea/workflows/make_png.yaml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
name: Make PNG
|
||||||
|
run-name: ${{ gitea.actor }} is recording the PNG output.
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-app:
|
||||||
|
runs-on: linux_amd64
|
||||||
|
steps:
|
||||||
|
- name: Checkout current
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: curr
|
||||||
|
submodules: recursive
|
||||||
|
- name: Checkout previous
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: prev
|
||||||
|
fetch-depth: 2
|
||||||
|
submodules: recursive
|
||||||
|
- run: cd prev && git checkout HEAD^
|
||||||
|
- name: Build current
|
||||||
|
run: cmake -S curr -B curr/build -DGLERMINAL_TEST=ON && cmake --build curr/build
|
||||||
|
- name: Build previous
|
||||||
|
run: cmake -S prev -B prev/build -DGLERMINAL_TEST=ON && cmake --build prev/build
|
||||||
|
- name: Generate PNG file for current
|
||||||
|
run: cd curr/build/tests && XDG_RUNTIME_DIR=$PWD xvfb-run -a -s="-screen 0 1280x800x24" ./test-basic
|
||||||
|
- name: Generate PNG file for previous
|
||||||
|
run: cd prev/build/tests && XDG_RUNTIME_DIR=$PWD xvfb-run -a -s="-screen 0 1280x800x24" ./test-basic
|
||||||
|
- name: Upload current PNG
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: basic
|
||||||
|
path: |
|
||||||
|
curr/build/tests/image.png
|
||||||
|
prev/build/tests/image.png
|
||||||
|
- name: Compare PNG files
|
||||||
|
run: diff curr/build/tests/image.png prev/build/tests/image.png
|
@ -529,7 +529,7 @@ namespace glerminal
|
|||||||
|
|
||||||
log(GL_DEBUG_TYPE_ERROR, 0, 0, "Could not compile vertex shader.");
|
log(GL_DEBUG_TYPE_ERROR, 0, 0, "Could not compile vertex shader.");
|
||||||
log(GL_DEBUG_TYPE_ERROR, 0, 0, info_log);
|
log(GL_DEBUG_TYPE_ERROR, 0, 0, info_log);
|
||||||
throw std::runtime_error("");
|
throw std::runtime_error("Could not compile vertex shader.");
|
||||||
}
|
}
|
||||||
|
|
||||||
glGetShaderiv(geometry_shader, GL_COMPILE_STATUS, &success);
|
glGetShaderiv(geometry_shader, GL_COMPILE_STATUS, &success);
|
||||||
@ -543,7 +543,7 @@ namespace glerminal
|
|||||||
|
|
||||||
log(GL_DEBUG_TYPE_ERROR, 1, 0, "Could not compile geometry shader.");
|
log(GL_DEBUG_TYPE_ERROR, 1, 0, "Could not compile geometry shader.");
|
||||||
log(GL_DEBUG_TYPE_ERROR, 1, 0, info_log);
|
log(GL_DEBUG_TYPE_ERROR, 1, 0, info_log);
|
||||||
throw std::runtime_error("");
|
throw std::runtime_error("Could not compile geometry shader.");
|
||||||
}
|
}
|
||||||
|
|
||||||
glGetShaderiv(fragment_shader, GL_COMPILE_STATUS, &success);
|
glGetShaderiv(fragment_shader, GL_COMPILE_STATUS, &success);
|
||||||
@ -557,7 +557,7 @@ namespace glerminal
|
|||||||
|
|
||||||
log(GL_DEBUG_TYPE_ERROR, 2, 0, "Could not compile fragment shader.");
|
log(GL_DEBUG_TYPE_ERROR, 2, 0, "Could not compile fragment shader.");
|
||||||
log(GL_DEBUG_TYPE_ERROR, 2, 0, info_log);
|
log(GL_DEBUG_TYPE_ERROR, 2, 0, info_log);
|
||||||
throw std::runtime_error("");
|
throw std::runtime_error("Could not compile fragment shader.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// link
|
// link
|
||||||
@ -584,7 +584,7 @@ namespace glerminal
|
|||||||
|
|
||||||
log(GL_DEBUG_TYPE_ERROR, 3, 0, "Could not link shader program.");
|
log(GL_DEBUG_TYPE_ERROR, 3, 0, "Could not link shader program.");
|
||||||
log(GL_DEBUG_TYPE_ERROR, 3, 0, info_log);
|
log(GL_DEBUG_TYPE_ERROR, 3, 0, info_log);
|
||||||
throw std::runtime_error("");
|
throw std::runtime_error("Could not link shader program.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup uniforms
|
// setup uniforms
|
||||||
@ -613,7 +613,7 @@ namespace glerminal
|
|||||||
|
|
||||||
log(GL_DEBUG_TYPE_ERROR, 4, 0, "Could not compile screen vertex shader.");
|
log(GL_DEBUG_TYPE_ERROR, 4, 0, "Could not compile screen vertex shader.");
|
||||||
log(GL_DEBUG_TYPE_ERROR, 4, 0, info_log);
|
log(GL_DEBUG_TYPE_ERROR, 4, 0, info_log);
|
||||||
throw std::runtime_error("");
|
throw std::runtime_error("Could not compile screen vertex shader.");
|
||||||
}
|
}
|
||||||
|
|
||||||
glGetShaderiv(screen_fragment_shader, GL_COMPILE_STATUS, &success);
|
glGetShaderiv(screen_fragment_shader, GL_COMPILE_STATUS, &success);
|
||||||
@ -626,7 +626,7 @@ namespace glerminal
|
|||||||
|
|
||||||
log(GL_DEBUG_TYPE_ERROR, 5, 0, "Could not compile screen fragment shader.");
|
log(GL_DEBUG_TYPE_ERROR, 5, 0, "Could not compile screen fragment shader.");
|
||||||
log(GL_DEBUG_TYPE_ERROR, 5, 0, info_log);
|
log(GL_DEBUG_TYPE_ERROR, 5, 0, info_log);
|
||||||
throw std::runtime_error("");
|
throw std::runtime_error("Could not compile screen fragment shader.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// link
|
// link
|
||||||
@ -645,7 +645,7 @@ namespace glerminal
|
|||||||
|
|
||||||
log(GL_DEBUG_TYPE_ERROR, 6, 0, "Could not link screen shader program.");
|
log(GL_DEBUG_TYPE_ERROR, 6, 0, "Could not link screen shader program.");
|
||||||
log(GL_DEBUG_TYPE_ERROR, 6, 0, info_log);
|
log(GL_DEBUG_TYPE_ERROR, 6, 0, info_log);
|
||||||
throw std::runtime_error("");
|
throw std::runtime_error("Could not link screen shader program.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup uniforms for screen shader
|
// setup uniforms for screen shader
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
unsigned char pixels[1280 * 800 * 3];
|
unsigned char pixels[(GRID_WIDTH * CELL_SCALE * 8) * (GRID_HEIGHT * CELL_SCALE * 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, 1280 * 3);
|
stbi_write_png("image.png", GRID_WIDTH * CELL_SCALE * 8, GRID_HEIGHT * CELL_SCALE * 8, 3, pixels, GRID_WIDTH * CELL_SCALE * 8 * 3);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user