mirror of
https://github.com/nicbarker/clay.git
synced 2026-02-06 12:48:49 +00:00
C++20 Support (#31)
This commit is contained in:
parent
21d9f06a47
commit
948b7ce70b
9 changed files with 371 additions and 246 deletions
12
examples/cpp-project-example/CMakeLists.txt
Normal file
12
examples/cpp-project-example/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
cmake_minimum_required(VERSION 3.28)
|
||||
project(clay_examples_cpp_project_example CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g")
|
||||
|
||||
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_RELEASE "-O3")
|
||||
10
examples/cpp-project-example/main.cpp
Normal file
10
examples/cpp-project-example/main.cpp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include <iostream>
|
||||
#define CLAY_IMPLEMENTATION
|
||||
#include "../../clay.h"
|
||||
|
||||
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});
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue