linux part

This commit is contained in:
Альберт Гадиев 2025-03-01 11:12:22 +06:00
parent 0cc3dce9a8
commit b9e88547e6
7 changed files with 19 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#include "Math.h"
#include <exception>
#include <cmath>
namespace ZL {
Vector2f operator+(const Vector2f& x, const Vector2f& y)

View File

@ -10,6 +10,12 @@
#include "emscripten.h"
#endif
#ifdef __linux__
#include <GL/gl.h>
#include <GL/glu.h>
#include <GLES3/gl3.h>
#endif
#include <exception>
#include <stdexcept>

View File

@ -1,4 +1,5 @@
#include "Physics.h"
#include <cmath>
namespace ZL
{

View File

@ -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)
```

View File

@ -29,7 +29,8 @@ namespace ZL {
VAOHolder::~VAOHolder()
{
#ifndef EMSCRIPTEN
glDeleteVertexArray(1, &vao);
glDeleteVertexArrays(1, &vao);
#endif
}

View File

@ -1,5 +1,5 @@
#include "Utils.h"
#include <cstring>
#include <iterator>
#include <vector>
#include <iostream>

View File

@ -5,7 +5,8 @@
#include <exception>
#include <map>
#include <stack>
#include <memory>
#include <unordered_map>
namespace ZL
{
std::string readTextFile(const std::string& filename);