Bootstrap AS3
parent
8b385c2172
commit
0b97402ab8
|
|
@ -0,0 +1,12 @@
|
||||||
|
cmake_minimum_required(VERSION 3.18)
|
||||||
|
project(as3 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(as3 as3.cpp)
|
||||||
|
target_link_libraries(as3 PUBLIC raylib raylib_cpp)
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
# Building and Running
|
||||||
|
|
||||||
|
Clone the repository, navigate to the root of the project, and initialize the
|
||||||
|
submodules:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/humanoidsandvichdispenser/cs381.git
|
||||||
|
cd cs381
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
Navigate to the `as3` directory, create a build directory, and run CMake to
|
||||||
|
generate the build files:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd as3
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
```
|
||||||
|
|
||||||
|
Compile the code using `make`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
This should create an executable named `as3` in the `build` directory. You can
|
||||||
|
run the executable with the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./as3
|
||||||
|
```
|
||||||
|
|
||||||
|
# Instructions on how to use the program
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
#include "Color.hpp"
|
||||||
|
#include "raylib.h"
|
||||||
|
#include <raylib-cpp.hpp>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
raylib::Window window(800, 600, "CS381 - Assignment 0");
|
||||||
|
window.SetState(FLAG_WINDOW_RESIZABLE);
|
||||||
|
|
||||||
|
window.SetTargetFPS(60); // save cpu cycles
|
||||||
|
|
||||||
|
while (!window.ShouldClose()) {
|
||||||
|
window.BeginDrawing();
|
||||||
|
|
||||||
|
window.ClearBackground(raylib::Color::RayWhite());
|
||||||
|
|
||||||
|
window.EndDrawing();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue