feat: rewrite to cpp + refactor into files

This commit is contained in:
2026-02-11 19:56:47 +01:00
parent 40f6b874cf
commit a8b73927d8
7 changed files with 377 additions and 445 deletions

10
include/shader.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef H_SHADER_
#define H_SHADER_
#include <GLES2/gl2.h>
GLuint compile_shader(GLenum type, const char *src);
GLuint create_program(const char *vs_src, const char *fs_src);
#endif // H_SHADER_

27
include/state.h Normal file
View File

@@ -0,0 +1,27 @@
#ifndef H_STATE
#define H_STATE
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
typedef struct {
struct wl_display *display;
EGLDisplay egl_display;
struct wl_egl_window *egl_window;
EGLSurface egl_surface;
bool ready;
struct wl_compositor *compositor;
struct xdg_wm_base *wm_base;
struct wl_surface *w_surface;
struct xdg_surface *x_surface;
struct xdg_toplevel *toplevel;
struct wl_shm *shm;
struct wl_callback *frame_callback;
GLuint program;
} State;
#endif // H_STATE