shadermeh/shadermeh.h

62 lines
1.1 KiB
C

/* SPDX-License-Identifier: ISC */
/*
* shadermeh.h
*
* Copyright (C) 2022 David Oberhollenzer <goliath@infraroot.at>
*/
#ifndef SHADERMEH_H
#define SHADERMEH_H
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <time.h>
#define AUDIO_SAMPLES (512)
#define AUDIO_CHANNELS (2)
typedef struct {
Window wnd;
GLXContext gl;
bool visible;
} window;
window *window_create(unsigned int width, unsigned int height,
const char *caption);
void window_make_current(window *wnd);
void window_swap_buffers(window *wnd);
void window_set_vsync(window *wnd, int enable);
void window_destroy(window *wnd);
void window_show(window *wnd);
void window_hide(window *wnd);
bool window_handle_events(void);
GLuint shader_program_load(const char *fsh);
int shader_program_get_build_status(GLuint prog);
void shader_program_print_info_log(GLuint prog);
#endif /* SHADERMEH_H */