{"id":23912177,"url":"https://github.com/colleagueriley/rsgl_ui","last_synced_at":"2025-06-24T15:34:26.268Z","repository":{"id":270428419,"uuid":"910346684","full_name":"ColleagueRiley/RSGL_ui","owner":"ColleagueRiley","description":"Single-header UI extension for RSGL ","archived":false,"fork":false,"pushed_at":"2024-12-31T05:06:23.000Z","size":1276,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-31T05:18:36.172Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ColleagueRiley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-31T03:27:14.000Z","updated_at":"2024-12-31T05:07:43.000Z","dependencies_parsed_at":"2024-12-31T05:18:38.300Z","dependency_job_id":"d1db1840-fbe1-4851-8338-78fbda986453","html_url":"https://github.com/ColleagueRiley/RSGL_ui","commit_stats":null,"previous_names":["colleagueriley/rsgl_ui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColleagueRiley%2FRSGL_ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColleagueRiley%2FRSGL_ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColleagueRiley%2FRSGL_ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColleagueRiley%2FRSGL_ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColleagueRiley","download_url":"https://codeload.github.com/ColleagueRiley/RSGL_ui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240356096,"owners_count":19788512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-05T08:58:33.992Z","updated_at":"2025-02-23T17:45:20.291Z","avatar_url":"https://github.com/ColleagueRiley.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSGL_UI\n![The RSGL logo](https://github.com/ColleagueRiley/RSGL/blob/main/RSGL_logo.png?raw=true)\n\nA Single-header UI extension for RSGL \n---\n[RSGL](https://github.com/ColleagueRiley/RSGL) is a modular simple-to-use cross-platform graphics library. It attempts to combine the freedoms of low libraries with modern C techniques. Thus offering simplicity and convenience.\n\nThe RSGL.h header itself does not handle rendering nor input devices itself, both must be handled externally.  \n\n`RSGL_gl.h` is used by default for rendering, it renders via OpenGL 1.0 - 4.4.\n\n`RSGL_rgfw.h` is used by default for handling input devices. There is also a example GLFW backend, `examples/advanced/RSGL_glfw.h`\n\n# Build statuses\n![Linux workflow](https://github.com/ColleagueRiley/RSGL_ui/actions/workflows/linux.yml/badge.svg)\n![Windows workflow windows](https://github.com/ColleagueRiley/RSGL_ui/actions/workflows/windows.yml/badge.svg)\n![MacOS workflow windows](https://github.com/ColleagueRiley/RSGL_ui/actions/workflows/macos.yml/badge.svg)\n\n# Features\n- Easily swappable rendering module \n- Easily swappable the backend module\n- Small widget library with dynamic GUI via a convenient styling system\n- (RSGL_rgfw.h OR RSGL_glfw.h) (for RSGL_ui.h) Supports multiple platforms, Windows, MacOS, Linux, etc\n\n# Contacts\n- email : ColleagueRiley@gmail.com \n- discord : ColleagueRiley\n- discord server : https://discord.gg/pXVNgVVbvh\n\n# RSGL_ui \nRSGL_ui widgets are WIP, the supported widgets include\\\nRSGL_alignRect, RSGL_button (checkboxes, toggle buttons, combo boxes, sliders and radio buttons) and widget containers \\\n\nRSGL_textBox and RSGL_expandableRect are currently WIP.\n\n# Using RSGL_ui\n\n## header-only\n  To link RSGL you must add the line.\n  ```c\n  #define RSGL_IMPLEMENTATION\n  ```\n  in exactly one file which includes the `RSGL.h` header.\n  \n  You could also use the command line argument `-D RSGL_IMPLEMENTATION`.\n\n  Optionally, RSGL can be compiled into a .o or .so file and link it.\n\n## Compiling RSGL\n  Compiling RSGL isn't required. But if you want to, here's how.\n\n  ```sh\n  make\n  ```\n  \n  This will compile RSGL into a static library into a shared library.\n  You can also compile RSGL by hand.\n\n### compiling by hand\n1) Compile the library into an object file by running `gcc -x c -c RSGL.h -fPIC`.\n2) After you compile the library into an object file, you can also turn the object file into a static or shared library.\n3) To compile statically run `ar rcs RSGL.a RSGL.o`\n4) To compile RSGL into a shared library, run `gcc -shared RSGL.o \u003csystem libs\u003e`\n```\n  windows:\n    gcc -shared RSGL.o  -lshell32 -lgdi32 -lwinmm -o RSGL.dll\n  linux:\n    gcc -shared RSGL.o -lX11 -lXcursor -lXrandr -o RSGL.so\n  macos:\n    gcc -shared RSGL.o -framework Foundation -framework AppKit -framework CoreVideo\n```\n\n# Examples\n\n## a basic example\n\n```c\n#define RSGL_IMPLEMENTATION\n#include \"RSGL_rgfw.h\"\n\nint main(void) {\n\tRGFW_setGLVersion(RGFW_GL_COMPATIBILITY, 3, 3);\n\tRGFW_window* win = RGFW_createWindow(\"name\", (RSGL_rect){500, 500, 500, 500}, RGFW_CENTER);\n\n\tRSGL_init(RSGL_AREA(win-\u003er.w, win-\u003er.h), RGFW_getProcAddress);\n\n  RSGL_setFont(RSGL_loadFont(\"Super Easy.ttf\"));\n\t\n\tb8 toggle = false;\n\n\twhile (RGFW_window_shouldClose(win) == false) {\n\t\twhile (RSGL_checkEvent(win)) {\n      if (win-\u003eevent.type == RGFW_quit) {\n          break;\n      }\n    }\n\t\t\n\t\tRSGL_openBlankContainer(RSGL_RECT(0, 0, win-\u003er.w, win-\u003er.h));\n\t\t\n    RSGL_drawText(RSGL_strFmt(\"toggle %s\", toggle ? \"on\" : \"off\"), RSGL_CIRCLE(0, 40, 40), RSGL_RGB(255, 0, 0));\n\t\tRSGL_toggleButton(RSGL_RECTF(50, 125, 100, 50), RSGL_STYLE_LIGHT | RSGL_STYLE_ROUND, \u0026toggle);\n        \n\t\tRSGL_clear(RSGL_RGB(255, 255, 255));\n\t\tRGFW_window_swapBuffers(win);\n\n\t\tRGFW_window_checkFPS(win, 60);\n\t}\n\t\n\tRSGL_free();\n  RGFW_window_close(win);\n}\n```\n\nThis example can be compiled with :\\\nLinux:\\\n`gcc \u003cfile.c\u003e -lX11 -lGLX -lm -o example`\\\nWindows :\\\n`gcc \u003cfile.c\u003e -lopengl32 -lgdi32 -lshell32 -o example`\\\nMacOS :\\\n`gcc \u003cfile.c\u003e -lm -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo -o example`\n\nBoth of the included makefiles  (`Makefile` or `examples/Makefile`) use the Unlicense license so feel free to copy from either of them if you wish. \n\n## compiling \nthese can be compiled by running `make examples` in the current directory\\\n\nor by using the makefile in `examples/`\\\n\nThe Makefile in `examples/`  allows you to compile all the examples using `make`,\\\ncompile one specific example using `make \u003cexample\u003e` or\\\nrun `make debug` which compiles and runs each example in debug mode\n\nEnsure you're running the example in the `./examples` folder so the fonts are properly loaded. \n\nNOTE: Most of these examples use `RSGL_rgfw.h`, but you can use whatever backend you want.\n\n### RSGL_ui.h\n![example screenshot 2](https://github.com/ColleagueRiley/RSGL_ui/blob/main/screenshot2.PNG?raw=true)\n![example screenshot 3](https://github.com/ColleagueRiley/RSGL_ui/blob/main/screenshot3.PNG?raw=true)\n![example screenshot 4](https://github.com/ColleagueRiley/RSGL_ui/blob/main/screenshot4.PNG?raw=true)\n![example screenshot 5](https://github.com/ColleagueRiley/RSGL_ui/blob/main/screenshot5.PNG?raw=true)\n\n## advanced/glfw.c\n`examples/advanced/glfw.c` is an example that shows how you can use RSGL with GLFW\n\nThis example requires GLFW to be installed.\\\nYou can download GLFW [here](https://www.glfw.org/download)\n\n## button.c \n`examples/button.c` is an example that shows off how to create and manage buttons using RSGL,\nthese include, a default style button, a checkbox, a toggle button, radio buttons, a combo box, a slider and a custom button\n\n## styles.c\n`examples/styles.c` is an example that shows off button styles, there are groups of buttons for each style.\nThere is also a switch button that allows you to toggle dark mode.\n\n## container.c\n`examples/container.c` is an example that shows how to create and manage a widget container\n\n# License\nRSGL uses the Zlib/libPNG license, this means you can use RSGL 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.\n\n```\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n  \n1. The origin of this software must not be misrepresented; you must not\n   claim that you wrote the original software. If you use this software\n   in a product, an acknowledgment in the product documentation would be\n   appreciated but is not required. \n2. Altered source versions must be plainly marked as such, and must not be\n   misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolleagueriley%2Frsgl_ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolleagueriley%2Frsgl_ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolleagueriley%2Frsgl_ui/lists"}