Skip to content

Commit 18bcdb9

Browse files
update to 1.6
1 parent 3540edd commit 18bcdb9

File tree

3 files changed

+84
-46
lines changed

3 files changed

+84
-46
lines changed

CHANGELOG

Lines changed: 68 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,74 @@
11
changelog
22
---------
33

4-
Current Version: RGFW 1.6-dev
4+
Current Version: RGFW 1.6
55
-----------------------------------------------
6-
- fix wasm key event bug (key release events not being processed)
7-
- Get rid of `RGFW_ALLOC_DROPFILES` (it's not actually useful)
6+
7+
Release: RGFW 1.6 (Feb 25, 2025)
8+
-----------------------------------------------
9+
This release has been focused on ensuring feature parity with GLFW, reviewing included features and fixing bugs.
10+
11+
breaking changes:
812
- Replace `RGFW_window_setBufferPtr` and `RGFW_setBufferSize` with `RGFW_window_initBuffer`, `RGFW_window_initBufferSize` and `RGFW_window_initBufferPtr`
913
Also forces the user to run `RGFW_window_initBuffer` to allocate a buffer
10-
- Get rid of RGFW_allocator, most of the memory that needs to be allocated is optional and is allocated on init anyway.
14+
- add `vector` for raw mouse data (so `point` can be used to get the regular mouse point)
15+
- RGFW_setGLHint and RGFW_glHints enum
16+
- change RGFW_window_fullscreen to RGFW_window_setFullscreen
17+
- make RGFW_window_setFullscreen use exclusive fullscreen
18+
- limit directX support to RGFW_window_createDXSwapChain, most of it should/can be handled by the user
19+
- do not close the window until the (library) user closes it
20+
- add RGFW_monitorMode, move monitor.rect to mode.area and x, y to monitor
21+
- RGFW stalls on RGFW_quit
22+
23+
major changes:
24+
- RGFW_monitorMode, allows gives the user more control the monitor's mode (size, refreshRate, RGB)
25+
- lots of bug fixes
26+
- more windowing functions and checking functions (floating, focus, aspectRatio, etc)
27+
- RGFW_glHints and more OpenGL hint options (RGB, depth, robustness, release behavior, etc)
28+
- more examples
29+
30+
all changes:
31+
fixes:
32+
- fix wasm key event bug (key release events not being processed)
1133
- fix xDND data restarts bug
12-
- print errors in writeclipboard (X11)
13-
- fix macOS titlebar api (borderless window)
14-
- update Vulkan example (fix crashes with certain drivers, have triangle follow mouse)
1534
- rewrite writeclipboard, ensure the selection is properly being handled and the clipboard is properly being saved after the window is closed
16-
- add icon example
1735
- review winapi window_setIcon (fixes HICON persistance issue)
18-
- remove RGFW_mouseNone (fixes overflow bug, RGFW_mouseNone isn't used anyway)
19-
- expose RGFW_moveToMacOSResourceDir to the public API
36+
- make sure RGFW_mousePosCallback is called even for raw input events (winapi)
37+
- handle `WM_SYSKEYDOWN` and `WM_SYSKEYUP` events (winapi)
38+
- skip x11 mouse button events if the mouse button > 5
39+
- framework CoreVideo is needed to get the monitor's refresh rate (macOS)
40+
- move WM_PAINT to WndProc callback
41+
- ensure setFlag won't cause bugs when it's used to create a window
42+
- update Vulkan example (fix crashes with certain drivers, have triangle follow mouse)
43+
- ensure UTF8 support (winapi)
44+
- make RGFW_window_setFullscreen use exclusive fullscreen
45+
46+
new features:
47+
- add icon example
2048
- add `RGFW_window_center`
2149
- add `RGFW_window_borderless`, `RGFW_window_allowsDND` and `RGFW_window_mouseHidden` for checking for args
2250
- add flags example
2351
- fix `RGFW_window_setMaxSize` / `RGFW_window_setMinSize` winapi, use `SetPropA` `GetPropA` to get the window in `WndProc`
2452
- make RGFW_window_isMaximized actually maximize the window width the API
2553
- fix RGFW_window_setBorder not working after window creation (X11)
26-
- change b8/b32 to single changeable bool type `RGFW_bool`, add `RGFW_BOOL` macro for forcing an int to be bool
27-
- add `CONVENTIONS.md`
2854
- fix window flag bugs (macOS)
2955
- RGFW_window_maximize uses `toggleFullScreen` if the window has no border (macOS)
30-
- skip x11 mouse button events if the mouse button > 5
31-
- fix RGFW_window_eventWait, make sure RGFW_eventWaitNext is converted if it needs to be, ensure the correct time is used, (winapi, cocoa), make waitMS unsigned
3256
- add support for extra mouse buttons RGFW_mouseMisc1 - RGFW_mouseMisc5
3357
- separate maximize and fullscreen functions
3458
- add RGFW_window_setAspectRatio
35-
- add RGFW_window_scaleToMonitor AND RGFW_monitor_scale
36-
- add monitor/monitor.c example to show monitor scaling.
37-
- fix issues with examples compiling (macOS, wasm, X11)
38-
- remove microui_demo on wasm site
39-
- make the default bool type u8
40-
- make sure RGFW_mousePosCallback is called even for raw input events (winapi)
41-
- add `vector` for raw mouse data (so `point` can be used to get the regular mouse point)
42-
- replace API calls in RGFW_window_getMousePoint with `win->_lastMousePoint`
43-
- handle `WM_SYSKEYDOWN` and `WM_SYSKEYUP` events (winapi)
44-
- add RGFW_scrollLock keycode and RGFW_modScrollLock mod key
45-
- change RGFW_window_fullscreen to RGFW_window_setFullscreen
46-
- make RGFW_window_setFullscreen use exclusive fullscreen
47-
- add RGFW_window_isFullscreen
48-
- add refreshRate to RGFW_monitor_scale
49-
- limit directX support to RGFW_window_createDXSwapChain, most of it should/can be handled by the user
50-
- Add refreshRate to RGFW_monitor
51-
- do not close the window until the user closes it
5259
- add `RGFW_window_focus` and `RGFW_window_raise`
5360
- add `RGFW_window_isFloating`and `RGFW_window_setFloating`
5461
- add `RGFW_getCurrent_OpenGL`
5562
- add `RGFW_setXInstName`
5663
- add `RGFW_window_setOpacity`
5764
- add `RGFW_getTimerFreq` and `RGFW_getTimerValue`
58-
- framework CoreVideo is needed to get the monitor's refresh rate (macOS)
65+
- add RGFW_window_scaleToMonitor AND RGFW_monitor_requestMode
66+
- add monitor/monitor.c example to show monitor scaling.
5967
- add RGFW_window_setFlags
6068
- add RGFW_windowFloating flag
6169
- add RGFW_COCOA_GRAPHICS_SWITCHING option
6270
- add RGFW_setGLRGBA, RGFW_setGLAccumRGBA RGFW_setGLSRGB, RGFW_setGLRobustness, RGFW_setGLDebug, RGFW_setGLNoError
6371
- add RGFW_setGLReleaseBehavior and RGFW_glRelease enum
64-
- RGFW_setGLHint and RGFW_glHints enum
6572
- new opengl hint options:
6673
RGFW_glRed, RGFW_glGreen, RGFW_glBlue, RGFW_glAlpha
6774
RGFW_glDepth,
@@ -71,15 +78,38 @@ Current Version: RGFW 1.6-dev
7178
RGFW_glDebug
7279
RGFW_glNoError
7380
RGFW_glReleaseBehavior
74-
- add RGFW_monitorMode AND mode.red, mode.green, mode.blue
81+
- add RGFW_scrollLock keycode and RGFW_modScrollLock mod key
7582
- add `RGFW_monitorModeCompare`
76-
- change `RGFW_monitor_scale` to `RGFW_monitor_requestMode`
77-
- RGFW stalls on RGFW_quit
78-
- ensure monitor functions can be used prior to window creation
79-
- ensure UTF8 support (winapi)
83+
- Add refreshRate to RGFW_monitor
8084
- allow seticon to be undone
8185
- add `RGFW_window_setIconEx` (allows you to set titleBar icon, window icon or both)
86+
- add mode.red, mode.green, mode.blue
8287
- add smooth-resize example
88+
- Replace `RGFW_window_setBufferPtr` and `RGFW_setBufferSize` with `RGFW_window_initBuffer`, `RGFW_window_initBufferSize` and `RGFW_window_initBufferPtr`
89+
Also forces the user to run `RGFW_window_initBuffer` to allocate a buffer
90+
- add `vector` for raw mouse data (so `point` can be used to get the regular mouse point)
91+
- RGFW_setGLHint and RGFW_glHints enum
92+
- add RGFW_monitorMode, move monitor.rect to mode.area and x, y to monitor
93+
94+
miscellaneous changes:
95+
- Get rid of `RGFW_ALLOC_DROPFILES` (it's not actually useful)
96+
- Get rid of RGFW_allocator, most of the memory that needs to be allocated is optional and is allocated on init anyway.
97+
- print errors in writeclipboard (X11)
98+
- fix macOS titlebar api (borderless window)
99+
- remove RGFW_mouseNone (fixes overflow bug, RGFW_mouseNone isn't used anyway)
100+
- expose RGFW_moveToMacOSResourceDir to the public API
101+
- change b8/b32 to single changeable bool type `RGFW_bool`, add `RGFW_BOOL` macro for forcing an int to be bool
102+
- add `CONVENTIONS.md`
103+
- fix RGFW_window_eventWait, make sure RGFW_eventWaitNext is converted if it needs to be, ensure the correct time is used, (winapi, cocoa), make waitMS unsigned
104+
- fix issues with examples compiling (macOS, wasm, X11)
105+
- remove microui_demo on wasm site
106+
- make the default bool type u8
107+
- replace API calls in RGFW_window_getMousePoint with `win->_lastMousePoint`
108+
- ensure monitor functions can be used prior to window creation
109+
- change RGFW_window_fullscreen to RGFW_window_setFullscreen
110+
- limit directX support to RGFW_window_createDXSwapChain, most of it should/can be handled by the user
111+
- do not close the window until the (library) user closes it
112+
- RGFW stalls on RGFW_quit
83113

84114
Release: RGFW 1.5 (Jan 14, 2024)
85115
-----------------------------------------------

RGFW.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* RGFW 1.6-dev
3+
* RGFW 1.6
44
*
55
* Copyright (C) 2022-25 ColleagueRiley
66
*
@@ -1740,6 +1740,8 @@ no more event call back defines
17401740
#define RGFW_MOUSE_LEFT RGFW_BIT(28) /* if mouse left the window */
17411741
#define RGFW_WINDOW_ALLOC RGFW_BIT(29) /* if window was allocated by RGFW */
17421742
#define RGFW_BUFFER_ALLOC RGFW_BIT(30) /* if window.buffer was allocated by RGFW */
1743+
#define RGFW_WINDOW_INIT RGFW_BIT(31) /* if window.buffer was allocated by RGFW */
1744+
17431745

17441746
RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, RGFW_windowFlags flags) {
17451747
RGFW_window* win = (RGFW_window*)RGFW_ALLOC(sizeof(RGFW_window));
@@ -1784,15 +1786,20 @@ void RGFW_window_basic_init(RGFW_window* win, RGFW_rect rect, RGFW_windowFlags f
17841786
}
17851787
#endif
17861788

1789+
if (!(win->_flags & RGFW_WINDOW_ALLOC)) win->_flags = 0;
1790+
17871791
/* set and init the new window's data */
17881792
win->r = rect;
17891793
win->event.inFocus = 1;
17901794
win->event.droppedFilesCount = 0;
1791-
win->_flags = flags;
1795+
win->_flags |= flags;
17921796
win->event.keyMod = 0;
17931797
}
17941798

17951799
void RGFW_window_setFlags(RGFW_window* win, RGFW_windowFlags flags) {
1800+
RGFW_windowFlags cmpFlags = win->_flags;
1801+
if (win->_flags & RGFW_WINDOW_INIT) cmpFlags = win->_flags;
1802+
17961803
#ifndef RGFW_NO_MONITOR
17971804
if (flags & RGFW_windowScaleToMonitor) RGFW_window_scaleToMonitor(win);
17981805
#endif
@@ -1803,15 +1810,16 @@ void RGFW_window_setFlags(RGFW_window* win, RGFW_windowFlags flags) {
18031810
if (flags & RGFW_windowNoBorder) RGFW_window_setBorder(win, 0);
18041811
else RGFW_window_setBorder(win, 1);
18051812
if (flags & RGFW_windowFullscreen) RGFW_window_setFullscreen(win, RGFW_TRUE);
1806-
else if (win->_flags & RGFW_windowFullscreen) RGFW_window_setFullscreen(win, 0);
1813+
else if (cmpFlags & RGFW_windowFullscreen) RGFW_window_setFullscreen(win, 0);
18071814
if (flags & RGFW_windowMaximize) RGFW_window_maximize(win);
1808-
else if (win->_flags & RGFW_windowMaximize) RGFW_window_restore(win);
1815+
else if (cmpFlags & RGFW_windowMaximize) RGFW_window_restore(win);
18091816
if (flags & RGFW_windowHideMouse) RGFW_window_showMouse(win, 0);
1810-
else if (win->_flags & RGFW_windowHideMouse) RGFW_window_showMouse(win, 1);
1817+
else if (cmpFlags & RGFW_windowHideMouse) RGFW_window_showMouse(win, 1);
18111818
if (flags & RGFW_windowCocoaCHDirToRes) RGFW_moveToMacOSResourceDir();
18121819
if (flags & RGFW_windowFloating) RGFW_window_setFloating(win, 1);
1813-
else if (win->_flags & RGFW_windowFloating) RGFW_window_setFloating(win, 0);
1820+
else if (cmpFlags & RGFW_windowFloating) RGFW_window_setFloating(win, 0);
18141821

1822+
if (!(win->_flags & RGFW_WINDOW_INIT)) win->_flags |= RGFW_WINDOW_INIT;
18151823
win->_flags = flags;
18161824
}
18171825

@@ -6504,7 +6512,7 @@ RGFW_event* RGFW_window_checkEvent(RGFW_window* win) {
65046512

65056513
if (win->event.type == RGFW_quit) return &win->event;
65066514

6507-
if ((win->event.type == RGFW_windowMoved || win->event.type == RGFW_windowResized)
6515+
if ((win->event.type == RGFW_windowMoved || win->event.type == RGFW_windowResized || win->event.type == RGFW_windowRefresh)
65086516
&& !(win->_flags & RGFW_EVENT_PASSED))
65096517
{
65106518
win->_flags |= RGFW_EVENT_PASSED;

examples/smooth-resize/smooth-resize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void draw(RGFW_window* win) {
1818
RGFW_window_swapBuffers(win);
1919
}
2020

21-
void resize(RGFW_window* win) { glViewport(0, 0, win->r.w, win->r.h); }
21+
void resize(RGFW_window* win, RGFW_rect rect) { glViewport(0, 0, rect.w, rect.h); }
2222
void refresh(RGFW_window* win) { printf("refresh\n"); draw(win); }
2323

2424
int main(void) {

0 commit comments

Comments
 (0)