diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-01-12 00:02:33 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-01-12 00:06:31 +0100 |
commit | 4d8a8e846cb954c8e6f546cbde2f7f8ebb8c8ca2 (patch) | |
tree | 4899b7caf260c3a231ba9319a6560fa2dba0b93e /src/compositor.c | |
parent | 33bb199fd798131dd1bfd5e3fa4b7563881014b6 (diff) |
Diffstat (limited to 'src/compositor.c')
-rw-r--r-- | src/compositor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compositor.c b/src/compositor.c index c6b2059..29d3c15 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -100,7 +100,7 @@ void ngxc_compositor_add_window(ngxc_compositor *self, Window window) { window_obj->y = xattr.y; self->num_windows++; - fprintf(stderr, "ADDED WINDOW: %ld, x: %d, y: %d\n", window, xattr.x, xattr.y); + fprintf(stderr, "ADDED WINDOW (#%d): %ld, x: %d, y: %d\n", self->num_windows, window, xattr.x, xattr.y); } static void ngxc_compositor_remove_window_index(ngxc_compositor *self, int window_index) { @@ -178,13 +178,13 @@ static void render_texture(GLuint texture_id, int x, int y, int width, int heigh } /* TODO: Skip windows that are not visible on the screen */ -/* TODO: Disable compositing for fullscreen windows, if that option is enabled */ +/* TODO: Disable compositing for fullscreen windows, if that option is enabled. Or only draw the fullscreen window */ void ngxc_compositor_render(ngxc_compositor *self) { glClearColor(0.5f, 0.5f, 0.5f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); if(self->wallpaper_texture.texture_id > 0) { - render_texture(self->wallpaper_texture.texture_id, 0, 0, self->wallpaper_texture.width, self->wallpaper_texture.height); + //render_texture(self->wallpaper_texture.texture_id, 0, 0, self->wallpaper_texture.width, self->wallpaper_texture.height); } for(int i = 0; i < self->num_windows; ++i) { @@ -201,7 +201,7 @@ void ngxc_compositor_render(ngxc_compositor *self) { glFinish(); const double time_limit = 1.0f / 60.0f; // TODO: Get from randr. This might not be a good way to do this when using multiple monitors with different refresh rate and opengl is synced to one monitor - const double delayed_update = time_limit - frame_duration - 0.003; + const double delayed_update = time_limit - frame_duration - 0.002; //fprintf(stderr, "delayed update: %f\n", delayed_update); if(delayed_update > 0.0) usleep(delayed_update * 1000000.0); |