prosperon/source/engine/window.h

37 lines
901 B
C
Raw Normal View History

2021-11-30 21:29:18 -06:00
#ifndef WINDOW_H
#define WINDOW_H
2022-01-19 16:43:21 -06:00
#include <SDL2/SDL.h>
2021-11-30 21:29:18 -06:00
#include <stdbool.h>
struct mSDLWindow {
SDL_Window *window;
SDL_GLContext glContext;
int id;
int width;
int height;
/* TODO: Bitfield these */
bool render;
bool mouseFocus;
bool keyboardFocus;
bool fullscreen;
bool minimized;
bool shown;
float projection[16];
};
2022-01-19 16:43:21 -06:00
struct Texture;
2021-11-30 21:29:18 -06:00
struct mSDLWindow *MakeSDLWindow(const char *name, int width, int height,
uint32_t flags);
void window_handle_event(struct mSDLWindow *w, SDL_Event * e);
2022-01-19 16:43:21 -06:00
void window_all_handle_events(SDL_Event *e);
2021-11-30 21:29:18 -06:00
void window_makecurrent(struct mSDLWindow *w);
void window_makefullscreen(struct mSDLWindow *w);
void window_togglefullscreen(struct mSDLWindow *w);
void window_swap(struct mSDLWindow *w);
2022-01-19 16:43:21 -06:00
void window_seticon(struct mSDLWindow *w, struct Texture *icon);
int window_hasfocus(struct mSDLWindow *w);
2021-11-30 21:29:18 -06:00
#endif