GithubHelp home page GithubHelp logo

colleagueriley / rgfw Goto Github PK

View Code? Open in Web Editor NEW
197.0 7.0 11.0 4.11 MB

A cross platform lightweight single-header simple-to-use window abstraction library for creating graphical programs or libraries.

License: Other

C 88.68% Makefile 2.85% HTML 8.48%
gui opengl winapi xlib glfw library macos silicon macosx cocoa

rgfw's Introduction

Riley's Graphics library FrameWork

THE RGFW Logo

Build statuses

workflow workflow windows workflow macOS

A cross-platform lightweight single-header very simple-to-use window abstraction library for creating graphics Libraries or simple graphical programs.

About

RGFW is a free multi-platform single-header very simple-to-use window abstraction framework for creating graphics Libraries or simple graphical programs. it is meant to be used as a very small and flexible alternative library to GLFW.

The window backend supports XLib (UNIX), Cocoas (MacOS), webASM (emscripten) and WinAPI (tested on windows XP, 10 and 11, and reactOS)
Windows 95 & 98 have also been tested with RGFW, although results are iffy

The graphics backend supports OpenGL (EGL, software, OSMesa, GLES), Vulkan, DirectX and software rendering buffers.

RGFW was designed as a backend for RSGL, but it can be used standalone or for other libraries, such as Raylib which uses it as an optional alternative backend.

RGFW is multi-paradigm,
By default RGFW uses a flexible event system, similar to that of SDL, however you can use callbacks if you prefer that method.

This library

  1. is single header and portable (written in C99 in mind)
  2. is very small compared to other libraries
  3. only depends on system API libraries, Winapi, X11, Cocoa
  4. lets you create a window with a graphics context (OpenGL, Vulkan or DirectX) and manage the window and its events only with a few function calls

This library does not

  1. Handle any rendering for you (other than creating your graphics context)
  2. do anything above the bare minimum in terms of functionality

examples

examples

The examples can also run in your browser with emscripten

compiling

The examples can be compiled by using make debug, which compiles them in debug mode and then runs them
or make which simply compiles them.

The dx11 example has its own Makefile functions because it is Windows only, those include make DX11 and make debugDX11

You can do CC=compiler to specify a specific compiler
Tested and supported compilers include, gcc, clang, [x86_64 / i686-w64]-w64-mingw32-gcc, cl (linux AND windows)

tcc has also been tested but work on linux only

basic

A basic example can be found in examples/basic, it includes a basic OpenGL example of just about all of RGFW's functionalities.

events

The event example can be found in examples/events, it shows all the events and the data they send.

callbacks

The callback example can be found in examples/callbacks, it shows all the events and the data they send, but processed with callbacks instead.

dx11

examples/dx11 is a minimalistic example of the use of DirectX with RGFW

gl33

examples/gl33 is a minimalistic example of the use of OpenGL 3.3 with RGFW, this example was made by AICDG

gles2

examples/gles2 is a minimalistic example of the use of OpenGL ES 2 with RGFW

vk10

examples/vk10 is a minimalistic example of the use of Vulkan with RGFW, this example was made by AICDG

It also includes examples/vk10/RGFW_vulkan.h which can be used to create a basic vulkan context for RGFW.

basic

A basic example can be found in examples/basic, it includes a basic OpenGL example of just about all of RGFW's functionalities.

buff

examples/buffer is an example that shows how you can use software rendering with RGFW using RGFW_BUFFER mode which allows you to render directly to the window's draw buffer.

PortableGL

examples/PortableGL is an example that shows how you'd use RGFW with portablegl.h.

first person camera

examples/first-person-camera is an example that shows how you'd make a game with a first person camera with RGFW

a very simple example

#define RGFW_IMPLEMENTATION
#include "RGFW.h"

u8 icon[4 * 3 * 3] = {0xFF, 0x00, 0x00, 0xFF,    0xFF, 0x00, 0x00, 0xFF,     0xFF, 0x00, 0x00, 0xFF,   0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF,     0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF};

void keyfunc(RGFW_window* win, u32 keycode, char keyName[16], u8 lockState, u8 pressed) {
    printf("this is probably early\n");
}

int main() {
    RGFW_window* win = RGFW_createWindow("name", RGFW_RECT(500, 500, 500, 500), (u64)RGFW_CENTER);

    RGFW_window_setIcon(win, icon, RGFW_AREA(3, 3), 4);
    
    RGFW_setKeyCallback(keyfunc); // you can use callbacks like this if you want 

    i32 running = 1;

    while (running) {
        while (RGFW_window_checkEvent(win)) { // or RGFW_window_checkEvents(); if you only want callbacks
            if (win->event.type == RGFW_quit || RGFW_isPressed(win, RGFW_Escape)) {
                running = 0;
                break;
            }

            if (win->event.type == RGFW_keyPressed) // this is the 'normal' way of handling an event
                printf("This is probably late\n");
        }
        
        glClearColor(0xFF, 0XFF, 0xFF, 0xFF);
        glClear(GL_COLOR_BUFFER_BIT);

        RGFW_window_swapBuffers(win);
    }

    RGFW_window_close(win);
}

Documentation

There is a lot of in-header-documentation, but more documentation can be found here

If you wish to build the documentation yourself, there is also a Doxygen file attached.

Bindings

Language platform APIs URL
C MacOS, Linux, Windows OpenGL, DirectX, Vulkan, Buffer (This Repo)
Python MacOS, Linux, Windows OpenGL and Buffer RGFW-Python
Odin MacOS, Linux, Windows OpenGL and Buffer RGFW-Odin

Feel free to do a PR if you want a binding added to the list

projects

Projects that use RGFW in some way
Feel free to do a PR if you want something added to the list

RSGL (made by the same author)

AltText
(Image functions as a button)

RSGL is A modular simple-to-use cross-platform graphics library for easily creating graphics apps and games. It combines the freedom of lower-level graphics libraries with modern C techniques, offering both simplicity and convenience.

It uses RGFW as a backend.

Raylib

Raylib is a simple and easy-to-use library to enjoy videogames programming.

Raylib uses RGFW as an optional alternative platform. rcore_desktop_rgfw.c

Raylib GO

Raylib go bindings for Raylib. With explicit support for RGFW. (PLATFORM_DESKTOP_RGFW)

Claymore

Claymore is a C Game Engine designed by Nycticebus that uses RGFW as a backend.

Silk

Silk is a single-header 2D graphics library that renders via software rendering. The repo includes examples using multiple libraries, including RGFW.

example_rgfw

PureDoom-RGFW

PureDOOM-RGFW is an example of the PureDOOM source port, using RGFW and miniaudio.

RGL (made by the same author)

AltText
(image functions as a button)

RGL is a simple ultra-lightweight OpenGL version abstraction layer HEAVILY based on RLGL that uses the OpenGL pipeline style.

It uses RGFW for it's examples

RFont (made by the same author)

AltText
(image functions as a button)

RFont is a simple-to-use single-header modular font rendering library written in C.

It uses RGFW for it's examples

Contacts

Supporting RGFW

Things you can do if you want to support the development of RGFW:

  • File issues of bugs, potential bugs, potential performance issues you find or any suggestions you have.
  • Code reviews, code reviews are always accepted
  • Feature requests
  • Pull requests, fixing issues, bugs, misspellings, etc.
  • Starring RGFW, a small thing but it means a lot to me
  • Sharing RGFW with others is the best way for RGFW to build and grow a community
  • Listing RGFW as a dependency if you use RGFW for a project

If you want to contribute to RGFW but don't know what to contribute, you can check the TODO file.

RGFW vs GLFW

RGFW is more portable, in part because single-header library. It does not force you to use callbacks and focuses on trying to be straightforward. RGFW tries to work with the programmer rather than forcing the programmer to work around it. It also uses far less RAM and storage than GLFW.

RGFW allows you to use callbacks optionally if you prefer that method.

Feature RGFW GLFW
.o size (avg) 46kb 280kb
.so size (avg) 94kb 433kb
.h size 224.1kb 256kb
memory ussage (linux) ~40 Mib 55.9 Mib
--- --- ---
fps counter X
multi-threading X
drag and drop (input)
drag and drop (output) X X
joystick input ~ (no macos support)
live window struct X
event pipeline (dynamic) X
multi-buffering
set icon based on bitmap
clipboard I/O
multi-window support
hide/show mouse
no resize window
no border window X
transparent window
key strings
custom cursors
wayland ~ (backwards comp.)
OpenGL
Vulkan
OpenGL ES
EGL
OSMesa
Direct X X

License

RGFW uses the Zlib/libPNG license, this means you can use RGFW freely as long as you do not claim you wrote this software, mark altered versions as such and keep the license included with the header.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
  
1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required. 
2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

rgfw's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rgfw's Issues

Cannot build with RGFW_EGL (Linux)

Getting lots of errors when trying to build the most barebones program:

#define RGFW_IMPLEMENTATION
#define RGFW_EGL
#include "RGFW.h"

int main() {
    RGFW_window* win = RGFW_createWindow("Test", RGFW_RECT(500, 500, 500, 500), RGFW_CENTER);
    RGFW_window_makeCurrent(win);
    RGFW_window_close(win);
}
In file included from examples/basic/main.c:3:
./RGFW.h: In function ‘RGFW_createOpenGLContext’:
./RGFW.h:2266:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 2266 |                 EGLint attribs[]{
      |                                 ^
./RGFW.h:2267:56: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 2267 |                         EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT,
      |                                                        ^
./RGFW.h:2267:102: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 2267 |                         EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT,
      |                                                                                                      ^
./RGFW.h:2268:26: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 2268 |                         0, 0, 0, 0
      |                          ^
./RGFW.h:2268:29: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 2268 |                         0, 0, 0, 0
      |                             ^
./RGFW.h:2268:32: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 2268 |                         0, 0, 0, 0
      |                                ^
./RGFW.h:2268:32: warning: statement with no effect [-Wunused-value]
./RGFW.h:2268:35: error: expected ‘;’ before ‘}’ token
 2268 |                         0, 0, 0, 0
      |                                   ^
      |                                   ;
 2269 |                 };
      |                 ~                  
./RGFW.h:2272:54: error: ‘RGFW_STENCIL’ undeclared (first use in this function); did you mean ‘GL_STENCIL’?
 2272 |                 RGFW_GL_ADD_ATTRIB(EGL_STENCIL_SIZE, RGFW_STENCIL);
      |                                                      ^~~~~~~~~~~~
./RGFW.h:2210:13: note: in definition of macro ‘RGFW_GL_ADD_ATTRIB’
 2210 |         if (attVal) { \
      |             ^~~~~~
./RGFW.h:2272:54: note: each undeclared identifier is reported only once for each function it appears in
 2272 |                 RGFW_GL_ADD_ATTRIB(EGL_STENCIL_SIZE, RGFW_STENCIL);
      |                                                      ^~~~~~~~~~~~
./RGFW.h:2210:13: note: in definition of macro ‘RGFW_GL_ADD_ATTRIB’
 2210 |         if (attVal) { \
      |             ^~~~~~
./RGFW.h:2211:17: error: ‘attribs’ undeclared (first use in this function)
 2211 |                 attribs[index] = attrib;\
      |                 ^~~~~~~
./RGFW.h:2272:17: note: in expansion of macro ‘RGFW_GL_ADD_ATTRIB’
 2272 |                 RGFW_GL_ADD_ATTRIB(EGL_STENCIL_SIZE, RGFW_STENCIL);
      |                 ^~~~~~~~~~~~~~~~~~
./RGFW.h:2273:49: error: ‘RGFW_SAMPLES’ undeclared (first use in this function); did you mean ‘EGL_SAMPLES’?
 2273 |                 RGFW_GL_ADD_ATTRIB(EGL_SAMPLES, RGFW_SAMPLES);
      |                                                 ^~~~~~~~~~~~
./RGFW.h:2210:13: note: in definition of macro ‘RGFW_GL_ADD_ATTRIB’
 2210 |         if (attVal) { \
      |             ^~~~~~
./RGFW.h:2274:63: error: ‘RGFW_majorVersion’ undeclared (first use in this function)
 2274 |                 RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MAJOR_VERSION, RGFW_majorVersion);
      |                                                               ^~~~~~~~~~~~~~~~~
./RGFW.h:2210:13: note: in definition of macro ‘RGFW_GL_ADD_ATTRIB’
 2210 |         if (attVal) { \
      |             ^~~~~~
./RGFW.h:2275:63: error: ‘RGFW_minorVersion’ undeclared (first use in this function)
 2275 |                 RGFW_GL_ADD_ATTRIB(EGL_CONTEXT_MINOR_VERSION, RGFW_minorVersion);
      |                                                               ^~~~~~~~~~~~~~~~~
./RGFW.h:2210:13: note: in definition of macro ‘RGFW_GL_ADD_ATTRIB’
 2210 |         if (attVal) { \
      |             ^~~~~~
./RGFW.h:2277:25: error: ‘RGFW_window_src’ has no member named ‘rSurf’
 2277 |                 win->src.rSurf = eglCreateContext(win->src.EGL_display, config, globalCtx, attribs);
      |                         ^
./RGFW.h:2281:25: error: ‘RGFW_EGLglobalContext’ undeclared (first use in this function)
 2281 |                         RGFW_EGLglobalContext = win->src.rSurf;
      |                         ^~~~~~~~~~~~~~~~~~~~~
./RGFW.h:2281:57: error: ‘RGFW_window_src’ has no member named ‘rSurf’
 2281 |                         RGFW_EGLglobalContext = win->src.rSurf;
      |                                                         ^
./RGFW.h:2283:106: error: ‘RGFW_window_src’ has no member named ‘rSurf’
 2283 |                 eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.rSurf);
      |                                                                                                          ^
./RGFW.h: In function ‘RGFW_closeEGL’:
./RGFW.h:2293:65: error: ‘RGFW_window_src’ has no member named ‘rSurf’
 2293 |                 eglDestroyContext(win->src.EGL_display, win->src.rSurf);
      |                                                                 ^
./RGFW.h: In function ‘RGFW_window_makeCurrent_OpenGL’:
./RGFW.h:5851:106: error: ‘RGFW_window_src’ has no member named ‘rSurf’
 5851 |                 eglMakeCurrent(win->src.EGL_display, win->src.EGL_surface, win->src.EGL_surface, win->src.rSurf);
      |                                                                                                          ^
make: *** [Makefile:57: basic] Error 1

Update: Same result when using RGFW_OPENGL_ES1 and RGFW_OPENGL_ES2.

Some build issues

I added the RGFW backend to my Raylib Go bindings and noticed a few issues with MinGW and macOS.

This happens when I try to compile with OSXCross:

$ CGO_ENABLED=1 CC=x86_64-apple-darwin21.4-clang GOOS=darwin GOARCH=amd64 go build -tags rgfw -ldflags "-linkmode external -s -w"

./platforms/../external/RGFW.h:892:15: error: redefinition of 'NSString' as different kind of symbol
/opt/osxcross/target/bin/../SDK/MacOSX12.3.sdk/usr/include/objc/NSObject.h:13:8: note: previous definition is here
In file included from rcore.c:502:
In file included from ./platforms/rcore_desktop_rgfw.c:76:
./platforms/../external/RGFW.h:896:15: error: redefinition of 'NSArray' as different kind of symbol
/opt/osxcross/target/bin/../SDK/MacOSX12.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:254:8: note: previous definition is here

I just "fixed" this but commenting offending lines, but with GitHub actions, there are more, I guess that SDK versions are different:

$ go build -tags rgfw
# github.com/gen2brain/raylib-go/raylib
In file included from rcore.c:502:
In file included from ./platforms/rcore_desktop_rgfw.c:80:
./platforms/../external/RGFW.h:896:15: error: redefinition of 'NSString' as different kind of symbol
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:8:111: note: previous definition is here
In file included from rcore.c:502:
In file included from ./platforms/rcore_desktop_rgfw.c:80:
./platforms/../external/RGFW.h:900:15: error: redefinition of 'NSArray' as different kind of symbol
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:8:32: note: previous definition is here
In file included from rcore.c:502:
In file included from ./platforms/rcore_desktop_rgfw.c:80:
./platforms/../external/RGFW.h:902:15: error: redefinition of 'NSImage' as different kind of symbol
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:8:112: note: previous definition is here
In file included from rcore.c:502:
In file included from ./platforms/rcore_desktop_rgfw.c:80:
./platforms/../external/RGFW.h:1000:9: error: redefinition of 'NSMakeRect'
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:151:18: note: previous definition is here
In file included from rcore.c:502:
In file included from ./platforms/rcore_desktop_rgfw.c:80:
./platforms/../external/RGFW.h:1010:10: error: redefinition of 'NSMakePoint'
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:137:19: note: previous definition is here
In file included from rcore.c:502:
In file included from ./platforms/rcore_desktop_rgfw.c:80:
./platforms/../external/RGFW.h:1017:9: error: redefinition of 'NSMakeSize'
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:144:18: note: previous definition is here

And then, there is the issue with MinGW:

CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -tags rgfw -ldflags '-s -w'
# github.com/gen2brain/raylib-go/raylib
In file included from platforms/rcore_desktop_rgfw.c:76,
                 from rcore.c:502:
platforms/../external/RGFW.h:134: warning: "WIN32" redefined
  134 | #define WIN32
      |
<built-in>: note: this is the location of the previous definition
platforms/../external/RGFW.h:138: warning: "WIN64" redefined
  138 | #define WIN64
      |
<built-in>: note: this is the location of the previous definition
platforms/rcore_desktop_rgfw.c:83: warning: "Rectangle" redefined
   83 | #define Rectangle struct Rectangle
      |
platforms/rcore_desktop_rgfw.c:65: note: this is the location of the previous definition
   65 | #define Rectangle rectangle_win32
      |
# examples/core/basic_window
/usr/lib/go/pkg/tool/linux_amd64/link: running x86_64-w64-mingw32-gcc failed: exit status 1
/usr/libexec/gcc/x86_64-w64-mingw32/ld: /tmp/go-link-2142769958/000015.o: in function `RGFW_sleep':
/home/milann/Projects/raylib-go/raylib/platforms/../external/RGFW.h:6082: undefined reference to `nanosleep'
/usr/libexec/gcc/x86_64-w64-mingw32/ld: /home/milann/Projects/raylib-go/raylib/platforms/../external/RGFW.h:6082: undefined reference to `nanosleep'
/usr/libexec/gcc/x86_64-w64-mingw32/ld: /home/milann/Projects/raylib-go/raylib/platforms/../external/RGFW.h:6082: undefined reference to `nanosleep'

The problem with nanosleep is on line 6077 #ifndef _MSC_VER, I just fixed this with #if !defined(_MSC_VER) && !defined(__MINGW32__).

Linux only had some redefinition errors, I hacked it with some undefs. They are unfortunate because I cannot silence only redefinition warnings.

Hope this is helpful.

RGFW_window_getMousePoint() returns global point coordinates on X11

When tested on Linux/X11, RGFW_window_getMousePoint() and RGFW_getGlobalMousePoint() return the same values.

In the RGFW_window_getMousePoint() implementation for X11 (line 2711), the second argument to XQueryPointer should be win->src.window, not XDefaultRootWindow((Display*) win->src.display).

Current Code

XQueryPointer((Display*) win->src.display, XDefaultRootWindow((Display*) win->src.display), &window1, &window2, &x, &y, &RGFWMouse.x, &RGFWMouse.y, &z);

Proposed Change

XQueryPointer((Display*) win->src.display, win->src.window, &window1, &window2, &x, &y, &RGFWMouse.x, &RGFWMouse.y, &z);

A speaker image appears near the RGFW application's icon when an audio source is played

As the title suggests, anytime music is being played from an application, a speaker icon appears near the RGFW application's. I presume this is a DE "feature" so to speak that has to be enabled/disabled via some WM-specific X11 atom.

Example 1: Audio is being played from the Audacious app
image
Example 2: No audio is being played at all
image

Note that in the first example image, the speaker icon doesn't appear for other applications that have audio-playing capabilities, like Chromium. This makes me believe that GTK has solved this issue somewhere in their code base, so the solution most likely lies somewhere in their source.

If this helps, here is additional information about the window manager (Kwin) that has this issue:

==========================

Version
=======
KWin version: 6.1.1
Qt Version: 6.7.2
Qt compile version: 6.7.2
XCB compile version: 1.17.0

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_X11_XCB: yes
HAVE_GLX: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 12101013
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.breeze
Theme: 
Plugin recommends border size: None
onAllDesktopsAvailable: false
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 0
gridUnit: 18
font: Noto Sans,10,-1,0,400,0,0,0,0,0,0,0,0,0,0,1
smallSpacing: 4
largeSpacing: 18

Output backend
==============
Name: KWin::X11StandaloneBackend

Cursor
======
themeName: breeze_cursors
themeSize: 36

Options
=======
focusPolicy: ClickToFocus
xwaylandCrashPolicy: 1
xwaylandMaxCrashCount: 3
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
placement: 5
activationDesktopPolicy: SwitchToOtherDesktop
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
edgeBarrier: 100
cornerBarrier: 1
rollOverDesktops: false
focusStealingPreventionLevel: 1
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: MouseRaise
commandActiveTitlebar2: MouseNothing
commandActiveTitlebar3: MouseOperationsMenu
commandInactiveTitlebar1: MouseActivateAndRaise
commandInactiveTitlebar2: MouseNothing
commandInactiveTitlebar3: MouseOperationsMenu
commandWindow1: MouseActivateRaiseAndPassClick
commandWindow2: MouseActivateAndPassClick
commandWindow3: MouseActivateAndPassClick
commandWindowWheel: MouseNothing
commandAll1: MouseUnrestrictedMove
commandAll2: MouseToggleRaiseAndLower
commandAll3: MouseUnrestrictedResize
keyCmdAllModKey: 16777250
condensedTitle: false
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
compositingMode: 1
useCompositing: true
hiddenPreviews: 1
glSmoothScale: 2
glStrictBinding: true
glStrictBindingFollowsDriver: true
glPreferBufferSwap: AutoSwapStrategy
glPlatformInterface: 1
windowsBlockCompositing: true
allowTearing: true

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: false
cursorPushBackDistance: 1x1
timeThreshold: 75
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Number of Screens: 1

Screen 0:
---------
Name: eDP-1
Enabled: 1
Geometry: 0,0,3840x2160
Scale: 1
Refresh Rate: 59996
Adaptive Sync: incapable

Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon RX Graphics (radeonsi, polaris11, LLVM 17.0.6, DRM 3.57, 6.9.6-arch1-1)
OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.1.2-arch1.1
OpenGL platform interface: GLX
OpenGL shading language version string: 4.60
Driver: Unknown
GPU class: Unknown
OpenGL version: 4.6
GLSL version: 4.60
Mesa version: 24.1.2
X server version: 1.21.1
Linux kernel version: 6.9.6
Direct rendering: Requires strict binding: yes
Virtual Machine:  no
OpenGL 2 Shaders are used

Loaded Effects:
---------------
screenshot
outputlocator
colorpicker
zoom
screenedge
blur
contrast
sessionquit
logout
login
slidingpopups
windowaperture
slide
squash
scale
morphingpopups
maximize
fullscreen
frozenapp
fadingpopups
dialogparent
windowview
tileseditor
overview
highlightwindow
blendchanges
startupfeedback
kscreen

Currently Active Effects:
-------------------------
blur
contrast

Effect Settings:
----------------
screenshot:

outputlocator:

colorpicker:

zoom:
zoomFactor: 1.2
mousePointer: 0
mouseTracking: 0
focusTrackingEnabled: false
textCaretTrackingEnabled: false
focusDelay: 350
moveFactor: 20
targetZoom: 1

screenedge:

blur:

contrast:

sessionquit:
pluginId: sessionquit
isActiveFullScreenEffect: false

logout:
pluginId: logout
isActiveFullScreenEffect: false

login:
pluginId: login
isActiveFullScreenEffect: false

slidingpopups:
slideInDuration: 200
slideOutDuration: 200

windowaperture:
pluginId: windowaperture
isActiveFullScreenEffect: false

slide:
horizontalGap: 45
verticalGap: 20
slideBackground: true

squash:
pluginId: squash
isActiveFullScreenEffect: false

scale:
pluginId: scale
isActiveFullScreenEffect: false

morphingpopups:
pluginId: morphingpopups
isActiveFullScreenEffect: false

maximize:
pluginId: maximize
isActiveFullScreenEffect: false

fullscreen:
pluginId: fullscreen
isActiveFullScreenEffect: false

frozenapp:
pluginId: frozenapp
isActiveFullScreenEffect: false

fadingpopups:
pluginId: fadingpopups
isActiveFullScreenEffect: false

dialogparent:
pluginId: dialogparent
isActiveFullScreenEffect: false

windowview:
activeView: 
delegate: 
animationDuration: 300
ignoreMinimized: false
mode: 
partialActivationFactor: 0
gestureInProgress: false
searchText: 
selectedIds: 

tileseditor:
activeView: 
delegate: 
animationDuration: 200

overview:
activeView: 
delegate: 
animationDuration: 300
ignoreMinimized: false
filterWindows: true
organizedGrid: true
overviewPartialActivationFactor: 0
overviewGestureInProgress: false
transitionPartialActivationFactor: 0
transitionGestureInProgress: false
gridPartialActivationFactor: 0
gridGestureInProgress: false
desktopOffset: 
searchText: 

highlightwindow:

blendchanges:

startupfeedback:
type: 1

kscreen:


Loaded Plugins:
---------------
krunnerintegration
nightlight

Available Plugins:
------------------
BounceKeysPlugin
StickyKeysPlugin
buttonsrebind
eis
krunnerintegration
nightlight
screencast

X11 window does not close properly on some systems

While all of the RGFW examples through the base Makefile compile just fine on LInux, quite a few of them do not work as intended at all.

Crashes/Do not run
Trying to run the vk10 example on Linux results in a segmentation fault, while trying to run basic results in the window being opened for a few frames before closing the window entirely. While I'm not sure as to why vk10 crashes (I do not use or know to use Vulkan), the basic example has a very silly issue, where the while loop only continues if the escape key is being pressed

while (running && RGFW_isPressed(win, RGFW_Escape)) {   

Add a ! unary operator before the function or a simple <function> == 0 comparison fixes this.

Cannot exit
Both events and callbacks suffer from the same issue of not being able to cleanly exit the app without forcing an exit via external means. To me my limited understanding this happens because the RGFW_window_shouldClose function doesn't catch the RGFW_quit for ??? reasons. Perhaps some other event replaces the .type member when the loop cycle is finished? I'm not sure exactly what's going on.

Unintended behaviour
The camera example goes absolutely crazy on my system:

2024-07-02_15-55-21.mp4

My theory as to why this happens is because that kind of effect (effect being seeing all of the windows and being able to select one) is achieved on KDE by moving the mouse cursor to the top left position. Thus, RGFW_window_mouseHold may be continuously moving the cursor to the (0 ,0) coordinates by mistake, even though looking at the source that shouldn't really happen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.