commit fa569fad5288cedc016a6eab5cc6ae2c08598de4 Author: NukeBird Date: Tue Feb 11 20:15:24 2025 +0300 Open basic window diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..56e0e43 --- /dev/null +++ b/.clang-format @@ -0,0 +1,4 @@ +BasedOnStyle: LLVM +BreakBeforeBraces: Allman +AccessModifierOffset: -4 +IndentWidth: 4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..22236d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +build/ +.cache + +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4b0e622 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.22.0) + +set(PROJECT_NAME cool_project) + +project(${PROJECT_NAME}) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +string(APPEND resources_dir "${CMAKE_CURRENT_SOURCE_DIR}/data@data") + +if (EMSCRIPTEN) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Oz -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY --preload-file ${resources_dir} --shell-file=\"${CMAKE_CURRENT_SOURCE_DIR}/shell.html\"") + set(CMAKE_EXECUTABLE_SUFFIX ".html") +endif () + +file(GLOB_RECURSE PROJECT_SRC src/*.cpp src/*.hpp src/*.h) + +find_package(raylib) +#find_package(spdlog) +find_package(nlohmann_json) + +add_executable(${PROJECT_NAME} ${PROJECT_SRC}) +target_link_libraries(${PROJECT_NAME} raylib nlohmann_json::nlohmann_json) diff --git a/CMakeUserPresets.json b/CMakeUserPresets.json new file mode 100644 index 0000000..f02c66f --- /dev/null +++ b/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build\\Debug\\generators\\CMakePresets.json" + ] +} \ No newline at end of file diff --git a/clang_profile b/clang_profile new file mode 100644 index 0000000..bd53558 --- /dev/null +++ b/clang_profile @@ -0,0 +1,18 @@ +[settings] +os=Windows +arch=x86_64 +build_type=Debug +compiler=clang +compiler.version=19 +compiler.cppstd=gnu17 +compiler.runtime=static +compiler.runtime_type=Debug +compiler.runtime_version=v143 + +[buildenv] +CC=clang +CXX=clang +RC=clang + +[conf] +tools.cmake.cmaketoolchain:generator=Ninja diff --git a/clang_wasm b/clang_wasm new file mode 100644 index 0000000..7bbebe2 --- /dev/null +++ b/clang_wasm @@ -0,0 +1,21 @@ +[settings] +os=Emscripten +arch=wasm +build_type=Debug +compiler=clang +compiler.version=19 +compiler.cppstd=gnu17 +compiler.runtime=static +compiler.runtime_type=Debug +compiler.runtime_version=v143 + +[buildenv] +CC=clang +CXX=clang +RC=clang + +[tool_requires] +emsdk/3.1.73 + +[conf] +tools.cmake.cmaketoolchain:generator=Ninja diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..2496da6 --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,20 @@ +#Anything can be here. Look for more libraries via conan search -r=all library_name +#Also you can check libs via https://conan.io/center +[requires] +raylib/5.5 +#spdlog/1.15.0 +nlohmann_json/3.11.3 +#glm/cci.20230113 +#glfw/3.4 +#glew/2.2.0 +#stb/cci.20240531 + +[options] +#blah:some_foo=True + +[generators] +CMakeDeps +CMakeToolchain + +[layout] +cmake_layout diff --git a/data/empty b/data/empty new file mode 100644 index 0000000..e69de29 diff --git a/data/img.jpg b/data/img.jpg new file mode 100644 index 0000000..2b76c4f Binary files /dev/null and b/data/img.jpg differ diff --git a/shell.html b/shell.html new file mode 100644 index 0000000..ec71588 --- /dev/null +++ b/shell.html @@ -0,0 +1,85 @@ + + + + + + + raylib web game + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + {{{ SCRIPT }}} + + diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..9f92a98 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,20 @@ +#include + +int main (int argc, char *argv[]) +{ + auto img = LoadImage("data/img.jpg"); + + InitWindow(img.width, img.height, ""); + SetTargetFPS(60); + + while (!WindowShouldClose()) + { + BeginDrawing(); + ClearBackground(WHITE); + EndDrawing(); + } + + CloseWindow(); + + return 0; +}