mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-20 05:08:04 +00:00
Final tweaks
This commit is contained in:
parent
24c4bcd565
commit
d68af1cbe0
2
.github/workflows/cmake-multi-platform.yml
vendored
2
.github/workflows/cmake-multi-platform.yml
vendored
@ -1,5 +1,3 @@
|
|||||||
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
|
|
||||||
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
|
|
||||||
name: CMake on multiple platforms
|
name: CMake on multiple platforms
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
@ -3,6 +3,7 @@ project(clay)
|
|||||||
|
|
||||||
add_subdirectory("examples/cpp-project-example")
|
add_subdirectory("examples/cpp-project-example")
|
||||||
|
|
||||||
|
# Don't try to compile C99 projects using MSVC
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
add_subdirectory("examples/raylib-sidebar-scrolling-container")
|
add_subdirectory("examples/raylib-sidebar-scrolling-container")
|
||||||
add_subdirectory("examples/clay-official-website")
|
add_subdirectory("examples/clay-official-website")
|
||||||
|
@ -394,13 +394,15 @@ The supported directives are:
|
|||||||
- `CLAY_EXTEND_CONFIG_IMAGE` - Provide additional struct members to `CLAY_IMAGE_CONFIG` that will be passed through with output render commands.
|
- `CLAY_EXTEND_CONFIG_IMAGE` - Provide additional struct members to `CLAY_IMAGE_CONFIG` that will be passed through with output render commands.
|
||||||
- `CLAY_EXTEND_CONFIG_CUSTOM` - Provide additional struct members to `CLAY_IMAGE_CONFIG` that will be passed through with output render commands.
|
- `CLAY_EXTEND_CONFIG_CUSTOM` - Provide additional struct members to `CLAY_IMAGE_CONFIG` that will be passed through with output render commands.
|
||||||
|
|
||||||
### Bindings
|
### Bindings for non C
|
||||||
|
|
||||||
Clay is usable out of the box as a `.h` include in both C99 and C++ with designated initializer support.
|
Clay is usable out of the box as a `.h` include in both C99 and C++20 with designated initializer support.
|
||||||
There are also supported bindings for other languages, including:
|
There are also supported bindings for other languages, including:
|
||||||
|
|
||||||
- [Odin Bindings](https://github.com/nicbarker/clay/tree/main/bindings/odin)
|
- [Odin Bindings](https://github.com/nicbarker/clay/tree/main/bindings/odin)
|
||||||
|
|
||||||
|
Unfortunately clay does **not** support Microsoft C11 or C17 via MSVC at this time.
|
||||||
|
|
||||||
### Debug Tools
|
### Debug Tools
|
||||||
|
|
||||||
Clay includes built-in UI debugging tools, similar to the "inspector" in browsers such as Chrome or Firefox. These tools are included in `clay.h`, and work by injecting additional render commands into the output [Clay_RenderCommandArray](#clay_rendercommandarray).
|
Clay includes built-in UI debugging tools, similar to the "inspector" in browsers such as Chrome or Firefox. These tools are included in `clay.h`, and work by injecting additional render commands into the output [Clay_RenderCommandArray](#clay_rendercommandarray).
|
||||||
|
10
clay.h
10
clay.h
@ -28,12 +28,6 @@
|
|||||||
#define CLAY_WASM_EXPORT(null)
|
#define CLAY_WASM_EXPORT(null)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#define CLAY_PACKED_ENUM : uint8_t
|
|
||||||
#else
|
|
||||||
#define CLAY_PACKED_ENUM __attribute__((__packed__))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Public Macro API ------------------------
|
// Public Macro API ------------------------
|
||||||
|
|
||||||
#define CLAY_LAYOUT(...) Clay__StoreLayoutConfig(CLAY__INIT(Clay_LayoutConfig) {__VA_ARGS__ })
|
#define CLAY_LAYOUT(...) Clay__StoreLayoutConfig(CLAY__INIT(Clay_LayoutConfig) {__VA_ARGS__ })
|
||||||
@ -113,11 +107,13 @@ static int CLAY__ELEMENT_DEFINITION_LATCH = 0;
|
|||||||
Clay__CloseElementWithChildren()
|
Clay__CloseElementWithChildren()
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define CLAY__ALIGNMENT(type) alignof(type)
|
|
||||||
#define CLAY__INIT(type) type
|
#define CLAY__INIT(type) type
|
||||||
|
#define CLAY__ALIGNMENT(type) alignof(type)
|
||||||
|
#define CLAY_PACKED_ENUM : uint8_t
|
||||||
#else
|
#else
|
||||||
#define CLAY__INIT(type) (type)
|
#define CLAY__INIT(type) (type)
|
||||||
#define CLAY__ALIGNMENT(type) (offsetof(struct { char c; type x; }, x))
|
#define CLAY__ALIGNMENT(type) (offsetof(struct { char c; type x; }, x))
|
||||||
|
#define CLAY_PACKED_ENUM __attribute__((__packed__))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -5,9 +5,7 @@ set(CMAKE_C_STANDARD 99)
|
|||||||
|
|
||||||
add_executable(clay_official_website main.c)
|
add_executable(clay_official_website main.c)
|
||||||
|
|
||||||
if(!MSVC)
|
|
||||||
target_compile_options(clay_official_website PUBLIC -Wall -Werror -Wno-unknown-pragmas)
|
target_compile_options(clay_official_website PUBLIC -Wall -Werror -Wno-unknown-pragmas)
|
||||||
endif()
|
|
||||||
target_include_directories(clay_official_website PUBLIC .)
|
target_include_directories(clay_official_website PUBLIC .)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
@ -1,5 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.28)
|
cmake_minimum_required(VERSION 3.28)
|
||||||
project(clay_examples_raylib_sidebar_scrolling_container C)
|
project(clay_examples_raylib_sidebar_scrolling_container C)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
# Adding Raylib
|
# Adding Raylib
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
Loading…
Reference in New Issue
Block a user