Commit graph

53 commits

Author SHA1 Message Date
Philosoph228 9a6c66912b
Implement bit flags to toggle GDI renderer features
Instead of `gdi_fabulous` introduced some bit flags for enabling/disabling features individually. Mainly for testing and benchmarking purposes of these features until we decide the best implementation for each of them. So they are enabled by setting flags with `Clay_Win32_SetRendererFlags()` in user code (demo in this case)
2025-04-02 11:54:35 +05:00
Philosoph228 a541f6aa9d
Make CreateFont call in one line 2025-04-02 11:46:41 +05:00
Philosoph228 607af63b08
Change HWND_DESKTOP to NULL in GetDC() calls
At first I liked the idea to use something more semantic to pass as `HWND` to get the screen device context. And there is a HWND_DESKTOP macro which just a simple alias to NULL, but it is actually designed for CreateWindow and naming isn't clear enough. It may confuse someone who reading code that we're trying to get not the screen dc, but that desktop window dc itself. So I won't stand out let it be NULL as that commonly used.
2025-04-02 11:37:55 +05:00
Philosoph228 b1910a45be
Add redefinition guards for RECTWIDTH/RECTHEIGHT macros 2025-04-02 11:28:57 +05:00
Philosoph228 222fd49793
Use CLAY_DISABLE_SIMD 2025-04-02 11:22:45 +05:00
Philosoph228 b2bbdf8760
Implement accurate rectangle blending and rounding
The implementation works by handling special cases where rectangles have semi-transparent background colors or rounded corners. For these cases, it first copies the underlying image region from the window device context, blends the rectangle on top of this captured background, and then draws the final result back to the window DC because we can't access and modify window dc bits directly. Also this approach requires custom pixel processing for color blending and uses sqrtf for precise anti-aliased corners, which isn't ideal for performance. A `gdi_fabulous` flag is provided to toggle this feature when needed.
2025-03-25 09:47:04 +05:00
Philosoph228 5a1d13f0a4
Add support for font loading and rendering 2025-03-24 05:50:10 +05:00
Emerald-Ruby 6186596b41
math.h include missing cause lots of warning logs 2025-03-15 21:51:36 +00:00
Nic Barker a7d46629b1
[Renderers/SDL2] Fix rounded corner border index 2025-03-13 09:52:16 +13:00
Nic Barker bee93bc7ba
[Renderers/Raylib] Reuse memory in raylib renderer for temporary string allocations 2025-03-13 09:51:44 +13:00
Nic Barker 3e39e444db Update README 2025-03-13 09:21:09 +13:00
hailey 6567f85eb3 Updated rectangle border rendering 2025-03-10 10:29:55 -05:00
hailey a92ec772e1 [Renderers/Win32_GDI] first pass, fixed build errors and added build script 2025-03-10 09:33:12 -05:00
__hexmaster111 a782df73a1
Added win32 samples (first pass) 2025-03-10 09:23:36 -05:00
__hexmaster111 3a9172ec4c
Merge branch 'nicbarker:main' into main 2025-03-10 09:12:52 -05:00
__hexmaster111 12319fc240
Updated measure text to support the defualt raylib font if the user spesfied font failed to load. (#305) 2025-03-05 10:13:42 +13:00
__hexmaster111 ad363f986c
Added missing CloseWindow() call for raylib as well 2025-03-03 16:08:34 -06:00
__hexmaster111 3612431e82
[Raylib Render] Dont call malloc and Free every frame so much 2025-03-03 16:04:07 -06:00
mizmar 375501fb89
[Renderers/SDL2] Fix rounded corner border index 2025-03-03 18:36:04 +01:00
Timothy Hoyt 47c8e9178e
[Renderers/SDL2] Make SDL_RenderCornerBorder static (#263) 2025-02-17 08:49:05 +13:00
irfan-zahir a62ee15758
[Renderers/SDL3] Enable sdl3 alpha blending (#261) 2025-02-17 08:48:19 +13:00
Timothy Hoyt eb553962e8
[Renderers/SDL2] Added rounded corner borders and fixed other issues (#258) 2025-02-14 10:14:11 +13:00
tomat bc2548e3ec
[Renderers/SDL3] Add image rendering and scissor support to SDL3 renderer (#246) 2025-02-13 10:02:06 +13:00
Julio Ernesto Rodríguez Cabañas eeb4520f48
[Renderers/SDL3] Use text engine to render text on the SDL3 renderer (#256) 2025-02-13 09:19:36 +13:00
Nic Barker 72af2a4020 [Compilers] Fix missing initializer warnings under -Wextra 2025-02-12 09:12:11 +13:00
tomat e7bc3869f7
[Renderers/SDL2] Add rounded rectangle support to sdl2 renderer; feature-completes sdl2 renderer (#245) 2025-02-07 11:26:49 +13:00
Nic Barker 9d940c1f8e
[Core] Replace config macros with a single unified configuration struct (#240) 2025-02-04 17:00:19 +13:00
Nic Barker 1bcf256e4d
[Core] Replace generated arrays with macro declarations, align cache lines to 64 bytes (#235) 2025-01-29 17:14:01 +13:00
Martin Evald e9f2e6c4f1
[Renderers/SDL2] Don't take addresses of temporaries. (#232) 2025-01-29 13:09:41 +13:00
Nic Barker 0a703de69a
[Core] Add z-index and string base to Render Commands (#227) 2025-01-26 15:28:35 +13:00
arnauNau c0dac38c87
[Renderers/SDL3] Add borders and rounded borders functionality. (#220) 2025-01-26 14:39:34 +13:00
arnauNau aba846a446
[Renderers/SDL3] Add rounded corners rectangle functionality (#219) 2025-01-23 09:30:24 +13:00
Nic Barker ec2b3b35ff [Renderers/Raylib] Early return 0 rather than segfault when Raylib fonts fail to load 2025-01-21 21:26:57 +13:00
Nic Barker 326325ffaf
[Core] Convert measureText pointer to value string slice (#214) 2025-01-20 11:27:22 +13:00
Daniel Collin e8025cc254
SetMesureText and SetQueryScrollOffset takes userData (#212) 2025-01-20 10:59:02 +13:00
Linus Probert 8e7e30dda6
[Renderers/SDL3] Adds an example using SDL3 as a renderer (#107)
Co-authored-by: Nic Barker <contact+github@nicbarker.com>
2025-01-19 14:35:41 +13:00
ppeb 4961f2153e
Extend SDL2 Renderer and SDL2-video-demo (#208) 2025-01-18 21:42:18 +13:00
Funto e11a394c25
[Compilers] Fix MSVC compilation with CMake (#178)
Co-authored-by: Nic Barker <contact+github@nicbarker.com>
2025-01-10 20:59:13 +13:00
vince 723f59dffd
[Renderers/Web] treat RenderCommand.commandType as uint8_t instead of uint32_t (#162) 2025-01-05 14:34:16 +13:00
Nic Barker ac473d6fe7
[Renderers/SDL2] Create initial SDL2 renderer (#115)
Co-authored-by: Junior Rantila <junior.rantila@gmail.com>
2024-12-28 19:15:22 +13:00
Anthony Carbajal 08033b03cb
[Renderers/Raylib] Update files for v5.5 release (#109) 2024-12-26 20:02:33 +13:00
Oleksii Bulba 35d72e5fba
Added window dimensions and title to Clay_Raylib_Initialize function (#56) 2024-12-19 21:34:20 +13:00
Justin 330e56a858
Include new cairo renderer (#48) 2024-11-19 15:03:39 +11:00
Nic Barker 51082d2f1e
Change lineSpacing text config attribute to lineHeight (#37) 2024-10-05 20:57:52 +13:00
Nic Barker c6ab57c638 Add font preload to web renderers and update README 2024-09-17 19:05:59 +12:00
Nic Barker a4f90a217d
Debug Tools (#15) 2024-09-16 21:34:59 +12:00
Nic Barker fd45138d57
Stardardisation / cleanup work for private API functions (#7) 2024-08-30 18:44:36 +12:00
Nic Barker ca2c625bb5
Rename Clay_Rectangle to Clay_BoundingBox (#4) 2024-08-28 16:13:28 +12:00
Nic Barker 52b6b0564e Improved HTML renderer and official website example 2024-08-28 11:03:20 +12:00
Nic Barker d0694f7144 Remove overflow trap from raylib renderer 2024-08-27 11:38:16 +12:00