all repos — mgba @ 9c92a29b28d1f81224ba28d5fc83a9481eccd5eb

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