Multi-type elements (#34)

This commit is contained in:
Nic Barker 2024-10-22 20:41:35 +13:00 committed by GitHub
parent 3dffbea2a3
commit 29133bc783
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 2296 additions and 2044 deletions

View file

@ -8,5 +8,5 @@ add_executable(clay_examples_cpp_project_example main.cpp)
target_include_directories(clay_examples_cpp_project_example PUBLIC .)
set(CMAKE_CXX_FLAGS_DEBUG "-Wall")
set(CMAKE_CXX_FLAGS_DEBUG "-Werror -Wall")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

View file

@ -2,9 +2,14 @@
#define CLAY_IMPLEMENTATION
#include "../../clay.h"
Clay_LayoutConfig layoutElement = Clay_LayoutConfig { .padding = {5} };
int main(void) {
uint64_t totalMemorySize = Clay_MinMemorySize();
Clay_Arena clayMemory = Clay_Arena { .label = CLAY_STRING("Clay Memory Arena"), .capacity = totalMemorySize, .memory = (char *)malloc(totalMemorySize) };
Clay_Initialize(clayMemory, Clay_Dimensions {1024,768});
Clay_BeginLayout();
CLAY(CLAY_RECTANGLE({ .color = {255,255,255,0} }), CLAY_LAYOUT(layoutElement)) {}
Clay_EndLayout();
return 0;
}