From d11bd1d21269c3eb48ef154917e3d6efed3cf90c Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 8 May 2024 01:58:26 +0530 Subject: Raylib basic trianagle display --- Makefile | 2 +- src/main.cpp | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 13ab15e..5bfc6d1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CC=g++ CFLAGS=-Wall -Wextra -Werror -Wswitch-enum -ggdb -fsanitize=address -fsanitize=undefined -std=c++17 -LIBS= +LIBS=-lm -lraylib ARGS= OUT=main.out diff --git a/src/main.cpp b/src/main.cpp index 1c5912b..68a69b9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,12 +9,21 @@ * Description: Entrypoint */ -#include +#include -using std::cout, std::endl; +#define WIDTH 800 +#define HEIGHT 600 int main(void) { - cout << "Hello, world!" << endl; + InitWindow(WIDTH, HEIGHT, "snek"); + while (!WindowShouldClose()) + { + BeginDrawing(); + ClearBackground(BLACK); + DrawTriangle({400, 0}, {100, 300}, {700, 300}, RED); + EndDrawing(); + } + CloseWindow(); return 0; } -- cgit v1.2.3-13-gbd6f