Removed switching between screenshots & xcb_errors

This commit is contained in:
Casey 2024-06-06 17:45:10 +03:00
parent acbf1bce14
commit ce2d129c9b
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
3 changed files with 6 additions and 4 deletions

View File

@ -3,8 +3,10 @@ LDFLAGS := -lm `pkg-config --libs raylib xcb xcb-composite`
OBJECTS = ./screenshot.o ./windowtree.o
all: scrall
scrall: $(OBJECTS) main.c
$(CC) $(CFLAGS) main.c $(LDFLAGS) -o scrall $(OBJECTS)
$(CC) $(CFLAGS) main.c $(OBJECTS) $(LDFLAGS) -o scrall
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@

View File

@ -26,6 +26,7 @@ int main(int argc, char **argv) {
Font font = LoadFontEx("/usr/share/fonts/Unifont/Unifont.ttf", 16, 0, 8192);
SetTargetFPS(30);
struct window_display {
Vector2 offset;
@ -47,12 +48,12 @@ int main(int argc, char **argv) {
for (int frame = 0; !WindowShouldClose(); frame++) {
BeginDrawing();
ClearBackground(Fade(BLACK, 0.9));
ClearBackground(BLACK);
BeginBlendMode(BLEND_ALPHA);
for (size_t i = 0; i < n_windows; i++) {
if (windows_snaps[i].texture.id != (unsigned int)-1 && ((frame / 10) % n_windows) == i) {
if (windows_snaps[i].texture.id != (unsigned int)-1) {
DrawTextureV(windows_snaps[i].texture, windows_snaps[i].offset, WHITE);
}
}

View File

@ -3,7 +3,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <xcb/composite.h>
#include <xcb/xcb_errors.h>
Image get_screenshot(xcb_connection_t *conn, xcb_window_t wid) {
xcb_generic_error_t *err = NULL;