45 lines
830 B
C
45 lines
830 B
C
#pragma once
|
|
#include <windows.h>
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#define WINDOW_CLASS_NAME "GearsWindowClass"
|
|
|
|
typedef struct
|
|
{
|
|
HMODULE module;
|
|
} Library;
|
|
|
|
typedef struct
|
|
{
|
|
HINSTANCE instance;
|
|
HWND handle;
|
|
u16 h, w;
|
|
b32 resize_requested;
|
|
} GameWindow;
|
|
|
|
typedef struct
|
|
{
|
|
FARPROC fn;
|
|
} Function;
|
|
|
|
b32 _LoadLib(const char *name, Library *out_lib);
|
|
b32 _LoadFn(const char *name, Library *lib, Function *out_fn);
|
|
|
|
b32 _InitPlatform();
|
|
rawptr _MemAlloc(isize size);
|
|
rawptr _MemAllocZeroed(isize size);
|
|
isize _GetPageSize();
|
|
|
|
i32 _EPrint(void const *str);
|
|
i32 _Printf(const char *fmt, va_list arg);
|
|
i32 _Printfln(const char *fmt, va_list arg);
|
|
i32 _EPrintf(const char *fmt, va_list arg);
|
|
|
|
b32 _CreateWindow();
|
|
GameWindow *_GetWindow();
|
|
void GetWindowEvents();
|
|
void WaitForWindowEvent();
|
|
WindowSize _GetWindowSize();
|