linux part
This commit is contained in:
parent
0cc3dce9a8
commit
b9e88547e6
2
Math.cpp
2
Math.cpp
@ -1,7 +1,7 @@
|
|||||||
#include "Math.h"
|
#include "Math.h"
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
#include <cmath>
|
||||||
namespace ZL {
|
namespace ZL {
|
||||||
|
|
||||||
Vector2f operator+(const Vector2f& x, const Vector2f& y)
|
Vector2f operator+(const Vector2f& x, const Vector2f& y)
|
||||||
|
|||||||
@ -10,6 +10,12 @@
|
|||||||
#include "emscripten.h"
|
#include "emscripten.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#include <GLES3/gl3.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include "Physics.h"
|
#include "Physics.h"
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
namespace ZL
|
namespace ZL
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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
|
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)
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -29,7 +29,8 @@ namespace ZL {
|
|||||||
VAOHolder::~VAOHolder()
|
VAOHolder::~VAOHolder()
|
||||||
{
|
{
|
||||||
#ifndef EMSCRIPTEN
|
#ifndef EMSCRIPTEN
|
||||||
glDeleteVertexArray(1, &vao);
|
glDeleteVertexArrays(1, &vao);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
#include <cstring>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
3
Utils.h
3
Utils.h
@ -5,7 +5,8 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
#include <memory>
|
||||||
|
#include <unordered_map>
|
||||||
namespace ZL
|
namespace ZL
|
||||||
{
|
{
|
||||||
std::string readTextFile(const std::string& filename);
|
std::string readTextFile(const std::string& filename);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user