aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-04-04 14:54:12 +0200
committerdec05eba <dec05eba@protonmail.com>2020-06-21 14:41:11 +0200
commitf9e99e57f9c193e70ca4abf5f33aa4f112b13e89 (patch)
treeea4a3b10ccf383d8c88817ac1c27fc36248f2fe8 /src/main.cpp
parent4418871737701ff4d966e6dc33e68c175c58d2dd (diff)
Add interactive record script
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 4d43cd7..5db9d6f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -743,7 +743,7 @@ int main(int argc, char **argv) {
double start_time = glfwGetTime();
double frame_timer_start = start_time;
double window_resize_timer = start_time;
- bool window_resized = true;
+ bool window_resized = false;
int fps_counter = 0;
int current_fps = 30;
@@ -841,7 +841,7 @@ int main(int argc, char **argv) {
window_width = e.xconfigure.width;
window_height = e.xconfigure.height;
window_resize_timer = glfwGetTime();
- window_resized = false;
+ window_resized = true;
}
}
@@ -894,13 +894,13 @@ int main(int argc, char **argv) {
}
const double window_resize_timeout = 1.0; // 1 second
- if(!window_resized && time_now - window_resize_timer >= window_resize_timeout) {
- window_resized = true;
+ if(window_resized && time_now - window_resize_timer >= window_resize_timeout) {
+ window_resized = false;
fprintf(stderr, "Resize window!\n");
recreate_window_pixmap(dpy, src_window_id, window_pixmap);
// Resolution must be a multiple of two
- video_stream->codec->width = window_pixmap.texture_width & ~1;
- video_stream->codec->height = window_pixmap.texture_height & ~1;
+ //video_stream->codec->width = window_pixmap.texture_width & ~1;
+ //video_stream->codec->height = window_pixmap.texture_height & ~1;
cuGraphicsUnregisterResource(cuda_graphics_resource);
res = cuGraphicsGLRegisterImage(