This commit is contained in:
2026-01-23 21:58:06 +01:00
parent a0aac7c79f
commit bdc4d59af3
5 changed files with 114 additions and 0 deletions

73
CMakeLists.txt Normal file
View File

@@ -0,0 +1,73 @@
# This file is automatically generated from cmake.toml - DO NOT EDIT
# See https://github.com/build-cpp/cmkr for more information
cmake_minimum_required(VERSION 3.15)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")
endif()
set(CMKR_ROOT_PROJECT OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CMKR_ROOT_PROJECT ON)
# Bootstrap cmkr and automatically regenerate CMakeLists.txt
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)
if(CMKR_INCLUDE_RESULT)
cmkr()
endif()
# Enable folder support
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Create a configure-time dependency on cmake.toml to improve IDE support
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS cmake.toml)
endif()
project(DREAM2026
LANGUAGES
C
CXX
VERSION
0.0.1
DESCRIPTION
"A 2D game engine based on Raylib."
)
# Target: DREAM2026
set(DREAM2026_SOURCES
cmake.toml
"src/Game/src/Game.cpp"
"src/main.cpp"
)
add_executable(DREAM2026)
target_sources(DREAM2026 PRIVATE ${DREAM2026_SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${DREAM2026_SOURCES})
target_compile_features(DREAM2026 PRIVATE
cxx_std_20
)
target_include_directories(DREAM2026 PRIVATE
"src/Game/src"
"src/Engine"
)
target_link_libraries(DREAM2026 PRIVATE
raylib
fmt
)
set_target_properties(DREAM2026 PROPERTIES
CXX_STANDARD
20
CXX_STANDARD_REQUIRED
ON
)
get_directory_property(CMKR_VS_STARTUP_PROJECT DIRECTORY ${PROJECT_SOURCE_DIR} DEFINITION VS_STARTUP_PROJECT)
if(NOT CMKR_VS_STARTUP_PROJECT)
set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT DREAM2026)
endif()

17
cmake.toml Normal file
View File

@@ -0,0 +1,17 @@
# Reference: https://build-cpp.github.io/cmkr/cmake-toml
[project]
name = "DREAM2026"
version = "0.0.1"
"description" = "A 2D game engine based on Raylib."
languages = ["C", "CXX"]
[target.DREAM2026]
type = "executable"
sources = ["src/main.cpp", "src/Engine/**.cpp", "src/Game/src/**.cpp"]
include-directories = ["src/Game/src", "src/Engine"]
compile-features = ["cxx_std_20"]
link-libraries = ["raylib", "fmt"]
[target.DREAM2026.properties]
CXX_STANDARD = 20
CXX_STANDARD_REQUIRED = true

0
src/Game/src/Game.cpp Normal file
View File

0
src/Game/src/Game.hpp Normal file
View File

24
src/main.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include "raylib.h"
int main(void) {
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "DREAM");
SetTargetFPS(60);
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(BLACK);
DrawText("whoever can read this is gay", 190, 200, 20, LIGHTGRAY);
EndDrawing();
}
CloseWindow();
return 0;
}