Commit graph

434 commits

Author SHA1 Message Date
Nic Barker
cd18666443 fix up examples 2026-03-31 12:12:56 +11:00
Nic Barker
272ca75651 Doc updates, add public func declaration for Clay_GetOpenElementId 2026-03-31 12:09:09 +11:00
Nic Barker
6965ba594c More readme updates 2026-03-31 11:41:41 +11:00
Nic Barker
b09befa895 Fix a bunch of documentation errors, rename some internal fields for clarity 2026-03-31 11:36:06 +11:00
Nic Barker
17bcb4a064 Update docs 2026-03-31 11:01:10 +11:00
Nic Barker
713e8a224c Docs for transitions 2026-03-31 09:55:23 +11:00
Nic Barker
13d0cb503c Partial documentation for transitions 2026-03-30 15:46:40 +11:00
Nic Barker
fa97ab6a27 Fix up debug view, disable position & width transitions on root layout resize 2026-03-30 14:00:21 +11:00
Nic Barker
442e008442 Avoid generating render commands when doing pre transition layout 2026-03-30 11:54:14 +11:00
Nic Barker
eeb0196568 Improve pointer handling and tidy up internal implementation' 2026-03-30 11:54:14 +11:00
Nic Barker
5c81c4f001 Fix nested transition bug, default to disabled entry / exit transitions while parent is entering / exiting 2026-03-30 11:54:14 +11:00
Nic Barker
eda0a8ba7a Improve handling of nested transitions involving reparenting 2026-03-30 11:54:14 +11:00
Nic Barker
fd815433f6 Correct handling of position transitions when dimensions are also transitioning 2026-03-30 11:54:14 +11:00
Nic Barker
77b54a2cec Seperate transitions into phases, allow transitions to affect layout 2026-03-30 11:54:14 +11:00
Nic Barker
74019b91ee Transitions for border width and color 2026-03-30 11:54:14 +11:00
Nic Barker
ac50892c74 Refactor transition algorithm, improve robustness of exit transitions 2026-03-30 11:54:14 +11:00
Nic Barker
5c12fbc231 Allow mouse interactions to be disabled during entire / exit transitions, fix some detection bugs 2026-03-30 11:54:14 +11:00
Nic Barker
21645dfafd Fix an issue where colour overlays weren't closed correctly 2026-03-30 11:54:14 +11:00
Nic Barker
86c6f595b2 Split bounding box transition properties into X, Y, WIDTH, HEIGHT 2026-03-30 11:54:14 +11:00
Nic Barker
91a443e620 Improve handling around parent enter / exit 2026-03-30 11:54:14 +11:00
Nic Barker
1cc915e837 Fix an issue where transitions without an exit handler defined weren't cleaned up properly 2026-03-30 11:54:14 +11:00
Nic Barker
c9031bde90 misc bug fixes 2026-03-30 11:54:14 +11:00
Nic Barker
99d053b340 cleanup 2026-03-30 11:54:14 +11:00
Nic Barker
05b5522947 draw the rest of the fucking owl 2026-03-30 11:54:11 +11:00
Nic Barker
c98eac6073 bug fixes 2026-03-30 11:53:32 +11:00
Nic Barker
6c1e603501 Aspect ratio data into reusable array 2026-03-30 11:53:32 +11:00
Nic Barker
eb30dd3f0a text element data to fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
7295c47413 Remove redundant array defines 2026-03-30 11:53:32 +11:00
Nic Barker
ab1ca629a6 Transitions to fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
41fa6b1c4b rectangle into fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
437389d50c Border config to fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
68128400a0 Clip config to fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
e302225150 Custom element configs to fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
ec40b3a3d7 Migrate floating config to fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
c30ecf867e image configs to fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
39114205f6 Convert aspect ratio config to fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
3c5f8ad07a move layout config into fat struct 2026-03-30 11:53:32 +11:00
Nic Barker
d055405670 Convert text element config to inline data 2026-03-30 11:53:32 +11:00
Nic Barker
65726b527f Partial commit 2026-03-30 11:53:32 +11:00
Nic Barker
a5839fe95d temp commit 2026-03-30 11:53:32 +11:00
Nic Barker
bc902a060a update 2026-03-30 11:53:31 +11:00
Nic Barker
997145568f small fixes 2026-03-30 11:53:31 +11:00
Nic Barker
cac8451491 property keys 2026-03-30 11:53:31 +11:00
Nic Barker
cde9667d56 initial commit 2026-03-30 11:53:31 +11:00
Nic Barker
c7f98dcfc6 [Core] Fix culling for scissor commands outside the window 2026-03-30 11:53:31 +11:00
github-actions[bot]
40350e593a [bindings/odin] Update Odin bindings 2026-03-30 00:52:10 +00:00
Bach Le
3be87f190b
Fix Clay__GetParentElementId for new id scheme (#521) 2026-03-30 11:51:26 +11:00
Luke 10X
76ec3632d8
[Renderers/GLES3] 📦 GLES3 renderer and demo examples using it (#565)
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Odin Bindings Update / check_changes (push) Has been cancelled
Odin Bindings Update / build (macos-latest) (push) Has been cancelled
Odin Bindings Update / build (ubuntu-latest) (push) Has been cancelled
Odin Bindings Update / commit (push) Has been cancelled
- **Initialize Window**:
  - Successfully created a GLFW window with dimensions 1280x720.
  - Set up window hints for OpenGL version and core profile, enabling multisampling, and enabling depth testing.

- **Setup Renderer**:
  - Initialized the Clay rendering context with a memory arena and dimensions.
  - Set up the measure text and render text functions using stb_image.h and stb_truetype.h.
  - Initialized the GLES3 renderer with 4096 texture units.
  - Loaded a Roboto-Regular font atlas and set it as the default font for rendering.

- **Main Loop**:
  - Called `Clay_UpdateScrollContainers` to handle scroll events.
  - Set the layout dimensions and cleared the color buffer and depth buffer.
  - Render the Clay video demo layout.
  - Swapped the window buffers to display the rendered video.

- **Cleanup**:
  - Cleaned up the GLFW window and renderer resources when the application is closed.

This setup provides a basic framework for rendering videos in GLES3 with GLFW, leveraging stb_image.h for asset loading and Clay for the rendering engine.

- Configure GLFW and SDL2 in the main files
- Fix the video bugs in the main file

🪝 Stb dependency to be managed with cmake in examples

💀 Allow clients to configure headers, also expose Gles3_Renderer through
header-only mode

🧹 Quality of life: automatically set screen dimensions to renderer

Before users had to set them manually

📚 **🎨 Renderers/GLES3:** Improve round-rectangle clipping with uniform border thickness

Implemented improvements to the renderer for GLES3, ensuring better handling of rounded rectangles with borders, making the layout more visually appealing.

- Added two new functions `RenderHeaderButton1`, `RenderHeaderButton2`, and `RenderHeaderButton3` for creating header buttons with different styles.
- Updated the `CreateLayout` function to include these new buttons in the right panel.
- Added a TODO note for handling the outer radius calculation, as it seems to be incorrect in the current implementation.

- Replace `bl_i + B` and `br_i + B` with `bl` and `br` respectively to simplify the code.
- Simplify the logic for checking pixel inside the inner rounded rect by directly using `innerLocal`.

📥 Change borders to be inset

- Fixed incorrect border calculation in the shader.
- Added support for inset borders by adjusting the boundary calculations based on `CLAY_BORDERS_ARE_INSET`.

This change also gives the renderer more choice in handling different border styles.

🏗️ CMake builds for GLES3 renderer examples
2025-12-30 18:52:27 +11:00
github-actions[bot]
7d099ad870 [bindings/odin] Update Odin bindings
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Odin Bindings Update / check_changes (push) Has been cancelled
Odin Bindings Update / build (macos-latest) (push) Has been cancelled
Odin Bindings Update / build (ubuntu-latest) (push) Has been cancelled
Odin Bindings Update / commit (push) Has been cancelled
2025-12-23 06:29:55 +00:00
Rats
681e085cd4
[Core] Include floating element count in text id hash (#567) 2025-12-23 17:29:09 +11:00