From b9e88547e64006dfe7aa6604ddda948b69378e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D1=8C=D0=B1=D0=B5=D1=80=D1=82=20=D0=93=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=B5=D0=B2?= Date: Sat, 1 Mar 2025 11:12:22 +0600 Subject: [PATCH] linux part --- Math.cpp | 2 +- OpenGlExtensions.h | 6 ++++++ Physics.cpp | 1 + Readme.md | 6 ++++++ Renderer.cpp | 3 ++- Utils.cpp | 2 +- Utils.h | 3 ++- 7 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Math.cpp b/Math.cpp index 48f2846..2396c35 100755 --- a/Math.cpp +++ b/Math.cpp @@ -1,7 +1,7 @@ #include "Math.h" #include - +#include namespace ZL { Vector2f operator+(const Vector2f& x, const Vector2f& y) diff --git a/OpenGlExtensions.h b/OpenGlExtensions.h index 6d5cf5e..a2347b2 100755 --- a/OpenGlExtensions.h +++ b/OpenGlExtensions.h @@ -10,6 +10,12 @@ #include "emscripten.h" #endif +#ifdef __linux__ +#include +#include +#include + +#endif #include #include diff --git a/Physics.cpp b/Physics.cpp index 03ea362..83a38e3 100755 --- a/Physics.cpp +++ b/Physics.cpp @@ -1,4 +1,5 @@ #include "Physics.h" +#include namespace ZL { diff --git a/Readme.md b/Readme.md index defe72f..46c6a61 100644 --- a/Readme.md +++ b/Readme.md @@ -2,4 +2,10 @@ ``` emcc main.cpp Game.cpp Math.cpp Physics.cpp Renderer.cpp ShaderManager.cpp TextureManager.cpp Utils.cpp OpenGlExtensions.cpp -O2 -std=c++14 -sTOTAL_MEMORY=33554432 -sUSE_SDL_IMAGE=2 -sSDL2_IMAGE_FORMATS="[""png""]" -sUSE_SDL=2 --preload-file background.bmp --preload-file bird.bmp32 --preload-file default.fragment --preload-file default.vertex --preload-file game_over.bmp32 --preload-file pipe.bmp32 -o jumpingbird.html +``` + +linux: +``` +g++ Game.cpp main.cpp Math.cpp OpenGlExtensions.cpp Physics.cpp Renderer.cpp ShaderManager.cpp TextureManager.cpp Utils.cpp -o sdl_app -O2 -std=c++14 $(pkg-config --cflags --libs sdl2 gl) + ``` \ No newline at end of file diff --git a/Renderer.cpp b/Renderer.cpp index 7f051d2..3b32490 100755 --- a/Renderer.cpp +++ b/Renderer.cpp @@ -29,7 +29,8 @@ namespace ZL { VAOHolder::~VAOHolder() { #ifndef EMSCRIPTEN - glDeleteVertexArray(1, &vao); + glDeleteVertexArrays(1, &vao); + #endif } diff --git a/Utils.cpp b/Utils.cpp index 81fac7c..5b80a8b 100755 --- a/Utils.cpp +++ b/Utils.cpp @@ -1,5 +1,5 @@ #include "Utils.h" - +#include #include #include #include diff --git a/Utils.h b/Utils.h index 97df7aa..fb4eaed 100755 --- a/Utils.h +++ b/Utils.h @@ -5,7 +5,8 @@ #include #include #include - +#include +#include namespace ZL { std::string readTextFile(const std::string& filename);