all repos — mgba @ c5d243fca282cf11d7f2c38010fce18361babdc2

mGBA Game Boy Advance Emulator

src/gba/renderers/video-glsl.h (view raw)

 1#ifndef VIDEO_GLSL_H
 2#define VIDEO_GLSL_H
 3
 4#include "gba-video.h"
 5
 6#include <pthread.h>
 7
 8#ifdef __APPLE__
 9#include <OpenGL/gl.h>
10#else
11#include <GL/gl.h>
12#endif
13
14struct GBAVideoGLSLRenderer {
15	struct GBAVideoRenderer d;
16
17	int y;
18	enum {
19		GLSL_NONE,
20		GLSL_DRAW_SCANLINE,
21		GLSL_FINISH_FRAME
22	} state;
23
24	GLuint fragmentShader;
25	GLuint vertexShader;
26	GLuint program;
27
28	GLuint vramTexture;
29	GLushort vram[512 * 256];
30	GLushort io[160][0x30];
31
32	uint16_t* oldVram;
33
34	pthread_mutex_t mutex;
35	pthread_cond_t upCond;
36	pthread_cond_t downCond;
37};
38
39void GBAVideoGLSLRendererCreate(struct GBAVideoGLSLRenderer* renderer);
40void GBAVideoGLSLRendererProcessEvents(struct GBAVideoGLSLRenderer* renderer);
41
42#endif