summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flag.glsl3
-rw-r--r--src/main.cpp5
2 files changed, 4 insertions, 4 deletions
diff --git a/flag.glsl b/flag.glsl
index f52c2f2..b7b4252 100644
--- a/flag.glsl
+++ b/flag.glsl
@@ -10,9 +10,8 @@ void main() {
uv.y += offset*uv.x*2.0 - 0.25;
vec4 col = texture2D(texture, uv*2.0);
- //col.rgb *= (1.0 + (0.0 + 0.5*(offset+0.04)*50.0));
col.rgb *= 0.9;
- col.rgb += 0.1 * -sine;
+ col.rgb += (0.1 * sine*(uv.x*2.0));
if(uv.x < 0.0 || uv.x > 0.5 || uv.y < 0.0 || uv.y > 0.5)
col.a = 0.0;
diff --git a/src/main.cpp b/src/main.cpp
index 0359622..12ac8eb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -13,7 +13,7 @@ int main() {
texture.setSmooth(true);
sf::Vector2u window_size = texture.getSize();
- sf::RenderWindow window(sf::VideoMode(window_size.x, window_size.y), "SFML works!", 0);
+ sf::RenderWindow window(sf::VideoMode(window_size.x, window_size.y), "SFML works!", 0, sf::ContextSettings(0, 0, 4));
window.setVerticalSyncEnabled(false);
window.setFramerateLimit(0);
@@ -65,7 +65,7 @@ int main() {
sf::Image output_image;
output_image.create(flag_width, flag_height, sf::Color::Transparent);
- const float playtime_sec = 2.0f;
+ const float playtime_sec = 1.78f;
const float frame_time = 1000.0 / (double)fps / 1000.0;
double elapsed_frame_time = 0.0;
@@ -93,6 +93,7 @@ int main() {
break;
}
+ window.close();
running = false;
work_thread.join();
system("ffmpeg -i \"frames/%d.png\" -framerate 24 -filter_complex \"fps=24,split=2[palette_in][gif];[palette_in]palettegen[palette_out];[gif]fifo[gif_fifo]; [gif_fifo][palette_out]paletteuse\" -y output.gif");