summaryrefslogtreecommitdiff
path: root/src/window_win32.h
blob: 7e639f08a973cf9c3c61234325506da776322f7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once

#include <al/wstr.h>
#include <al/array.h>
#include <nnwt/windows.h>

#include "window.h"

#define STELA_WIN32_KEY_MAX (VK_OEM_7 + 1)

struct stl_win32_global {
    HINSTANCE ModuleHandle;
    BOOL IsWine;
    HWND ServiceWindow;
#ifdef STELA_API_VULKAN
    const char **VKExtensions;
#endif
    HCURSOR Cursors[STELA_CURSOR_HIDDEN];
    u16 keycodes[STELA_WIN32_KEY_MAX];
    array(struct stl_monitor *) monitors;
    u32 argc;
    str *argv;
    void *extra;
    s32 (*main)(u32, str *, void *);
};

struct stl_monitor_win32 {
    struct stl_monitor M;
    s32 X;
    s32 Y;
    HMONITOR Handle;
};

struct stl_window_win32 {
    struct stl_window w;
    HWND Window;
    wstr WindowName;
    struct {
        struct stl_monitor_win32 *Monitor;
        s32 X;
        s32 Y;
        s32 Width;
        s32 Height;
        LONG Style;
        LONG ExStyle;
    } Prev;
    BOOL Closed;
    BOOL Decorated;
    BOOL UserDecorated;
    BOOL DragCapture;
    BOOL WindowMoving;
    POINTS LastMousePos;
    u32 MouseButtonMask;
#ifdef STELA_API_OPENGL
    HDC DeviceContext;
    HGLRC GLContext;
    HGLRC CurrentContext;
#endif
};