This commit is contained in:
2025-08-20 21:56:55 -05:00
parent 84f2735246
commit 3a753b1299
10 changed files with 220 additions and 97 deletions

54
src/display/display.h Normal file
View File

@@ -0,0 +1,54 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "error/error.h"
#if DUSK_DISPLAY_SDL2
#include <SDL2/SDL.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>
#endif
#ifndef DISPLAY_WIDTH
#define DISPLAY_WIDTH 320
#endif
#ifndef DISPLAY_HEIGHT
#define DISPLAY_HEIGHT 240
#endif
#ifndef DISPLAY_WINDOW_WIDTH_DEFAULT
#define DISPLAY_WINDOW_WIDTH_DEFAULT DISPLAY_WIDTH
#endif
#ifndef DISPLAY_WINDOW_HEIGHT_DEFAULT
#define DISPLAY_WINDOW_HEIGHT_DEFAULT DISPLAY_HEIGHT
#endif
typedef struct {
#if DUSK_DISPLAY_SDL2
SDL_Window *window;
SDL_GLContext glContext;
#endif
} display_t;
extern display_t DISPLAY;
/**
* Initializes the display system.
*/
errorret_t displayInit(void);
/**
* Tells the display system to actually draw the frame.
*/
errorret_t displayUpdate(void);
/**
* Disposes of the display system.
*/
errorret_t displayDispose(void);