src/platform/sdl/main.h (view raw)
1#ifndef SDL_MAIN_H
2#define SDL_MAIN_H
3
4#include "renderers/video-software.h"
5
6#include "sdl-audio.h"
7#include "sdl-events.h"
8
9#ifdef BUILD_GL
10#ifdef __APPLE__
11#include <OpenGL/gl.h>
12#else
13#include <GL/gl.h>
14#endif
15#endif
16
17struct SDLSoftwareRenderer {
18 struct GBAVideoSoftwareRenderer d;
19 struct GBASDLAudio audio;
20 struct GBASDLEvents events;
21
22#if SDL_VERSION_ATLEAST(2, 0, 0)
23 SDL_Window* window;
24#ifndef BUILD_GL
25 SDL_Texture* tex;
26 SDL_Renderer* sdlRenderer;
27#endif
28#endif
29
30 int viewportWidth;
31 int viewportHeight;
32 int ratio;
33
34#ifdef BUILD_GL
35 GLuint tex;
36#endif
37};
38
39void GBASDLInit(struct SDLSoftwareRenderer* renderer);
40void GBASDLRunloop(struct GBAThread* context, struct SDLSoftwareRenderer* renderer);
41
42#endif
43