Commit Graph

10 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
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