portability/native/window.hpp

36 lines
514 B
C++
Raw Normal View History

#pragma once
#include <stdint.h>
2018-03-02 14:04:47 +11:00
#ifdef _WIN32
#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"
#endif
struct Window {
2018-03-02 14:04:47 +11:00
#ifdef _WIN32
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;
#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;