2017-11-24 10:02:39 +11:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2018-03-02 14:04:47 +11:00
|
|
|
#ifdef _WIN32
|
2017-11-24 10:02:39 +11:00
|
|
|
#include <windows.h>
|
2018-03-02 14:04:47 +11:00
|
|
|
#elif __APPLE__
|
|
|
|
//TODO
|
|
|
|
#elif __unix__
|
2017-12-08 08:29:14 +11:00
|
|
|
#include <xcb/xcb.h>
|
2018-03-02 14:04:47 +11:00
|
|
|
#else
|
|
|
|
#error "unknown platform"
|
2017-11-24 10:02:39 +11:00
|
|
|
#endif
|
|
|
|
|
|
|
|
struct Window {
|
2018-03-02 14:04:47 +11:00
|
|
|
#ifdef _WIN32
|
2017-11-24 10:02:39 +11:00
|
|
|
HINSTANCE instance;
|
|
|
|
HWND window;
|
2018-03-02 14:04:47 +11:00
|
|
|
#elif __APPLE__
|
2020-09-20 10:46:22 +10:00
|
|
|
void *layer;
|
2017-12-08 08:29:14 +11:00
|
|
|
#else
|
|
|
|
xcb_connection_t *connection;
|
|
|
|
xcb_drawable_t window;
|
2017-11-24 10:02:39 +11:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Config {
|
|
|
|
uint32_t x;
|
|
|
|
uint32_t y;
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
};
|
|
|
|
|
|
|
|
auto new_window(Config config) -> Window;
|
|
|
|
auto poll_events() -> bool;
|