diff --git a/README.md b/README.md index 331fedd..4758631 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,11 @@ This will reduce the version to a compatibility version, reducing some features Note that some examples rely on features introduced in OpenGL4+, meaning that the required version of GLSL will not be available. All example programs are reduced to the **minimum necessary version**. +To compile library for WSL you have to set the flag otherwise you probably will not able to use it. Compile library as follows: +```bash +export CPPFLAGS="-DTINYENGINE_COMPATIBILITY" +make all +``` #### Shipping Resources TinyEngine supports the embedded shipping of resources in executables in a native way. It does this by utilizing [c-embed](https://github.com/weigert/c-embed) and desiging file-loading structures to use an `` style interface. To ship your resources (i.e. shaders, images, .obj files) as embedded in the executable, use the `c-embed` style make rule as follows: @@ -220,7 +225,7 @@ Currently TinyEngine has only been tested on linux (Ubuntu 18 LTS, Fedora 33) an #### Debian-Based Systems (e.g. Ubuntu) - OpenGL3: apt-get install libglu1-mesa-dev - - SDL2: apt-get install libsdl2-dev + - SDL2: apt-get install libsdl2-dev libsdl2-ttf-dev - GLEW: apt-get install libglew-dev - GLM: apt-get install libglm-dev @@ -234,7 +239,7 @@ Currently TinyEngine has only been tested on linux (Ubuntu 18 LTS, Fedora 33) an In a single command: ```bash -sudo apt-get install libglu1-mesa-dev libsdl2-dev libglew-dev libglm-dev +sudo apt-get install libglu1-mesa-dev libsdl2-dev libsdl2-ttf-dev libglew-dev libglm-dev ``` #### Fedora / DNF Package Manager Systems diff --git a/source/Makefile b/source/Makefile index 1c058cf..85ea015 100644 --- a/source/Makefile +++ b/source/Makefile @@ -6,7 +6,7 @@ LIBPATH = $(HOME)/.local/lib INCPATH = $(HOME)/.local/include # Compilation Settings -CC = g++ -std=c++17 +CC = g++ -std=c++17 $(CPPFLAGS) CF = -Wfatal-errors -O3 # MacOS: Dependencies install with homegrew @@ -17,7 +17,7 @@ TINYOS = -lX11 -lGL endif ifeq ($(UNAME), Darwin) #Detext MacOS INCPATH = /opt/homebrew/include -CC = g++-12 -std=c++17 +CC = g++-12 -std=c++17 $(CPPFLAGS) TINYOS = -framework OpenGL endif diff --git a/source/TinyEngine.cpp b/source/TinyEngine.cpp index d0a9759..a10e2ec 100644 --- a/source/TinyEngine.cpp +++ b/source/TinyEngine.cpp @@ -30,12 +30,16 @@ bool init(){ printf( "SDL could not initialize! Error: %s\n", SDL_GetError() ); return false; } - - #ifndef TINYENGINE_COMPATIBILITY + std::cout << "SDL Init done\n"; + + #ifdef TINYENGINE_COMPATIBILITY SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); + std::cout << "Comptibility mode ON\n"; + #else + std::cout << "Comptibility mode OFF\n"; #endif signal(SIGINT, &sighandler);