2021-11-30 21:29:18 -06:00
|
|
|
#ifndef WINDOW_H
|
|
|
|
#define WINDOW_H
|
|
|
|
|
2024-03-13 16:30:55 -05:00
|
|
|
#include <HandmadeMath.h>
|
|
|
|
|
2022-11-03 16:58:03 -05:00
|
|
|
struct window {
|
2023-08-31 02:05:06 -05:00
|
|
|
int id;
|
2024-03-13 16:30:55 -05:00
|
|
|
HMM_Vec2 size; // Actual width and height of the window
|
|
|
|
HMM_Vec2 rendersize; // The desired rendering resolution, what the assets are at
|
|
|
|
HMM_Vec2 psize;
|
|
|
|
float left;
|
|
|
|
float top;
|
2023-09-18 21:55:37 -05:00
|
|
|
double dpi;
|
2023-12-22 11:50:03 -06:00
|
|
|
int render;
|
|
|
|
int mouseFocus;
|
|
|
|
int keyboardFocus;
|
|
|
|
int fullscreen;
|
|
|
|
int minimized;
|
|
|
|
int iconified;
|
|
|
|
int focus;
|
|
|
|
int shown;
|
2024-03-13 16:30:55 -05:00
|
|
|
int mode;
|
|
|
|
float aspect;
|
|
|
|
float raspect;
|
|
|
|
char *title;
|
2024-04-10 16:21:46 -05:00
|
|
|
int vsync;
|
|
|
|
int enable_clipboard;
|
|
|
|
int enable_dragndrop;
|
|
|
|
int high_dpi;
|
|
|
|
int sample_count;
|
2024-03-13 16:30:55 -05:00
|
|
|
int start;
|
2021-11-30 21:29:18 -06:00
|
|
|
};
|
2024-03-13 16:30:55 -05:00
|
|
|
typedef struct window window;
|
2024-03-13 03:51:44 -05:00
|
|
|
struct texture;
|
2023-08-31 02:05:06 -05:00
|
|
|
extern struct window mainwin;
|
|
|
|
|
|
|
|
void window_resize(int width, int height);
|
|
|
|
void window_focused(int focus);
|
|
|
|
void window_iconified(int s);
|
|
|
|
void window_suspended(int s);
|
2022-02-06 10:14:57 -06:00
|
|
|
|
2024-03-13 16:30:55 -05:00
|
|
|
void window_apply(window *w);
|
|
|
|
void window_free(window *w);
|
|
|
|
|
|
|
|
void window_setfullscreen(window *w, int f);
|
2024-03-18 08:16:25 -05:00
|
|
|
void set_icon(const char *png);
|
2024-03-13 03:51:44 -05:00
|
|
|
void window_seticon(struct window *w, struct texture *icon);
|
2022-11-03 16:58:03 -05:00
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
#endif
|