You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.3 KiB

/* 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 <fcntl.h>
#include <poll.h>
#include <time.h>
#include <math.h>
#include <complex.h>
#include <fftw3.h>
#define AUDIO_SAMPLES (4096)
#define AUDIO_BUFFER_SIZE (sample_rate * 3)
#define AUDIO_FFT_SIZE (AUDIO_SAMPLES * 2)
#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 */