From 6ff0ede33135d60c1d3c270b06c992a0e31523cd Mon Sep 17 00:00:00 2001 From: HumanoidSandvichDispenser Date: Sun, 1 Feb 2026 16:50:14 -0800 Subject: [PATCH] Add AS0 files --- as0/CMakeLists.txt | 12 ++++++++++++ as0/as0.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 as0/CMakeLists.txt create mode 100644 as0/as0.cpp diff --git a/as0/CMakeLists.txt b/as0/CMakeLists.txt new file mode 100644 index 0000000..263188c --- /dev/null +++ b/as0/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.18) +project(as0 CXX) + +set(CMAKE_CXX_STANDARD 20) + +# adding this option to make clangd work +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +add_subdirectory(../raylib-cpp raylib) + +add_executable(as0 as0.cpp) +target_link_libraries(as0 PUBLIC raylib raylib_cpp) diff --git a/as0/as0.cpp b/as0/as0.cpp new file mode 100644 index 0000000..2f9a73d --- /dev/null +++ b/as0/as0.cpp @@ -0,0 +1,33 @@ +#include "Color.hpp" +#include "raylib.h" +#include + +int main() { + raylib::Window window(800, 600, "AS0"); + window.SetState(FLAG_WINDOW_RESIZABLE); + + while (!window.ShouldClose()) { + raylib::Text text; + int fontHeight = 20; + text.SetText("Hello World"); + text.SetFontSize(fontHeight); + text.SetSpacing(2); + text.SetColor(raylib::Color::Gray()); + + window.BeginDrawing(); + + window.ClearBackground(raylib::Color::RayWhite()); + + int width = window.GetWidth(); + int height = window.GetHeight(); + + int middleX = (width - text.Measure()) / 2; + int middleY = (height - fontHeight) / 2; + + text.Draw(middleX, middleY); + + window.EndDrawing(); + } + + return 0; +}