added raygui and tried to make it not throw errors
This commit is contained in:
BIN
.cache/clangd/index/main.c.329D1ED40D99E8B1.idx
Normal file
BIN
.cache/clangd/index/main.c.329D1ED40D99E8B1.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/raygui.h.B9CCA7B7A0CAA820.idx
Normal file
BIN
.cache/clangd/index/raygui.h.B9CCA7B7A0CAA820.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/raygui_impl.c.68F311B44C225DF3.idx
Normal file
BIN
.cache/clangd/index/raygui_impl.c.68F311B44C225DF3.idx
Normal file
Binary file not shown.
@@ -3,39 +3,64 @@ project(FPS_DRUID LANGUAGES C)
|
|||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
# Default build type for single-config generators
|
|
||||||
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ---------- Fetch raylib ----------
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
set(FETCHCONTENT_QUIET FALSE)
|
set(FETCHCONTENT_QUIET FALSE)
|
||||||
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
set(BUILD_GAMES OFF CACHE BOOL "" FORCE)
|
set(BUILD_GAMES OFF CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
# ---- raylib ----
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
raylib
|
raylib
|
||||||
GIT_REPOSITORY https://github.com/raysan5/raylib.git
|
GIT_REPOSITORY https://github.com/raysan5/raylib.git
|
||||||
GIT_TAG 5.5 # stable release
|
GIT_TAG 5.5
|
||||||
GIT_PROGRESS TRUE
|
GIT_PROGRESS TRUE
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(raylib)
|
FetchContent_MakeAvailable(raylib)
|
||||||
|
|
||||||
# ---------- Paths (match your tree) ----------
|
# ==== raygui (NEW) ====
|
||||||
|
FetchContent_Declare(
|
||||||
|
raygui_src
|
||||||
|
GIT_REPOSITORY https://github.com/raysan5/raygui.git
|
||||||
|
GIT_TAG master
|
||||||
|
GIT_PROGRESS TRUE
|
||||||
|
)
|
||||||
|
FetchContent_GetProperties(raygui_src)
|
||||||
|
if(NOT raygui_src_POPULATED)
|
||||||
|
FetchContent_Populate(raygui_src)
|
||||||
|
set(BUILD_RAYGUI_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
|
# raygui's CMakeLists is here:
|
||||||
|
add_subdirectory(${raygui_src_SOURCE_DIR}/projects/CMake ${raygui_src_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
# ======================
|
||||||
|
|
||||||
|
# ---- Paths ----
|
||||||
set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/src")
|
set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/src")
|
||||||
set(INC_DIR "${CMAKE_CURRENT_LIST_DIR}/include")
|
set(INC_DIR "${CMAKE_CURRENT_LIST_DIR}/include")
|
||||||
set(ASSETS_DIR "${CMAKE_CURRENT_LIST_DIR}/assets")
|
set(ASSETS_DIR "${CMAKE_CURRENT_LIST_DIR}/assets")
|
||||||
|
|
||||||
# ---------- Sources ----------
|
# ---- Sources ----
|
||||||
file(GLOB_RECURSE PROJECT_SOURCES CONFIGURE_DEPENDS "${SRC_DIR}/*.c")
|
file(GLOB_RECURSE PROJECT_SOURCES CONFIGURE_DEPENDS "${SRC_DIR}/*.c")
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES})
|
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES})
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE "${SRC_DIR}" "${INC_DIR}")
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE raylib)
|
|
||||||
|
|
||||||
# ---------- Warnings / ASan ----------
|
target_include_directories(${PROJECT_NAME}
|
||||||
|
PRIVATE
|
||||||
|
"${SRC_DIR}"
|
||||||
|
"${INC_DIR}"
|
||||||
|
# raygui headers
|
||||||
|
${raygui_src_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Link raylib + raygui
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE raylib raygui)
|
||||||
|
|
||||||
|
# ---- Warnings / ASan ----
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /permissive-)
|
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /permissive-)
|
||||||
else()
|
else()
|
||||||
@@ -46,14 +71,14 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ---------- Assets: copy next to the exe ----------
|
# ---- Assets copy ----
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
"${ASSETS_DIR}" "$<TARGET_FILE_DIR:${PROJECT_NAME}>/assets"
|
"${ASSETS_DIR}" "$<TARGET_FILE_DIR:${PROJECT_NAME}>/assets"
|
||||||
COMMENT "Copying assets next to the executable"
|
COMMENT "Copying assets next to the executable"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Compile-time asset root: absolute in Debug; relative otherwise
|
# Compile-time asset root
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
$<$<CONFIG:Debug>:ASSETS_PATH="${ASSETS_DIR}/">
|
$<$<CONFIG:Debug>:ASSETS_PATH="${ASSETS_DIR}/">
|
||||||
$<$<NOT:$<CONFIG:Debug>>:ASSETS_PATH="./assets/">
|
$<$<NOT:$<CONFIG:Debug>>:ASSETS_PATH="./assets/">
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#include "rlgl.h"
|
#include "rlgl.h"
|
||||||
#include "float.h"
|
#include "float.h"
|
||||||
|
#include "raygui.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Defines and Macros
|
// Defines and Macros
|
||||||
|
|||||||
5994
src/raygui.h
Normal file
5994
src/raygui.h
Normal file
File diff suppressed because it is too large
Load Diff
2
src/raygui_impl.c
Normal file
2
src/raygui_impl.c
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#define RAYGUI_IMPLEMENTATION
|
||||||
|
#include "raygui.h"
|
||||||
Reference in New Issue
Block a user