Skip to content

Commit

Permalink
Update fenster_windows.h
Browse files Browse the repository at this point in the history
  • Loading branch information
CardealRusso authored Nov 1, 2024
1 parent d6fd610 commit 28ef5e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fenster/fenster_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ static WINDOWPLACEMENT g_wpPrev = {

static HCURSOR cursors[6];
static int cursors_initialized = 0;
static int current_cursor_type = 1;

typedef struct BINFO {
BITMAPINFOHEADER bmiHeader;
Expand Down Expand Up @@ -221,6 +222,7 @@ FENSTER_API void fenster_fullscreen(struct fenster *f, int enabled) {
}

FENSTER_API void fenster_cursor(struct fenster *f, int type) {
if (type == current_cursor_type) return;
// Initialize cursors on first use
if (!cursors_initialized) {
cursors[0] = NULL; // Will be used for hidden cursor
Expand Down Expand Up @@ -253,5 +255,6 @@ FENSTER_API void fenster_cursor(struct fenster *f, int type) {
wc.hCursor = cursors[type];
SetClassLongPtr(f->hwnd, GCLP_HCURSOR, (LONG_PTR)cursors[type]);
}
current_cursor_type = type;
}
#endif /* FENSTER_WINDOWS_H */

0 comments on commit 28ef5e7

Please sign in to comment.