This is an example to illustrate Entity_ Component System.
Version | Description |
---|---|
0.0.8 | Bolt LifeSpan (Time) |
0.0.7 | Background moves as ship thrust up with Up Arrow Key |
0.0.6 | ??? |
0.0.5 | ??? |
0.0.4 | ??? |
0.0.3 | ??? |
0.0.2 | LoadTexture, CreateTextureWithSize and DestroyTexture |
0.0.1 | First Sample for a Rectangle Texture Rendered |
0.0.0 | Starting version |
- Following steps are made using cmake 3.10
- Check versions and availiability. Install if needed
g++ --version
cmake --version
-
Install dependent libraries:
- libpng-dev (or libpng-devel in OpenSuse)
- xorg-dev (or xorg-x11-devel in OpenSuse)
- libasound2-dev (or alsa-dev in OpenSuse)
- pulseaudio
- libs for SDL2 (look at the result of the
./configure
command)- libsamplerate
- libudev
- dbus
- ime
- ibus
- fcitx
-
Download SDL, SDL_IMAGE and GLM packages:
- SDL2-2.0.8.zip
- SDL2_image-2.0.3.zip
- glm-0.9.7.5.zip
-
Compile and install SDL2-2.0.8:
- Decompress SDL2-2.0.8.zip
- Enter the "SDL2-2.0.8" folder
- Run
./configure
(***) - Run
make
- Run
make install
(with sudo privileges)
-
Compile and install SDL2_image-2.0.3:
- Decompress SDL2_image-2.0.3.zip
- Enter the "SDL2_image-2.0.3" folder
- Run
./configure
- Run
make
- Run
make install
(with sudo privileges)
-
Compile and install glm-0.9.7.6:
- Decompress glm-0.9.7.6.zip
- Create folder "build"
- Enter the "build" folder
- Run
cmake ..
- Run
make
- Run
make install
(with sudo privileges)
-
Modify martin-the-martian files:
-
Open the CMakeLists.txt file and modify:
- Comment the line (prefixing it with #):
include(cmake/SDL.cmake)
- Comment the line:
include(cmake/MacOS.cmake)
- Comment the next lines:
PrintLine() HeaderMessage("SDL2 Libraries Linkage Addition") SDL_LINK(${ProjectName}) PrintLine() HeaderMessage("Cocoa Frameworks Linkage Addition") COCOA_LINK(${ProjectName})
- save the file.
- Comment the line (prefixing it with #):
-
Open the cmake/Sources.cmake file and modify:
- modify the line:
with this value:
target_link_libraries(${ProjectName} "-liconv" "-lm")
target_link_libraries(${ProjectName} "-lSDL2" "-lSDL2_image" "-lm")
- save the file.
- modify the line:
-
Open the src/sdlwrapper.cpp file and modify:
- modify the line:
with this value:
#include <SDL2_image/SDL_image.h>
#include <SDL2/SDL_image.h>
- save the file.
- modify the line:
-
Open the src/Sprite.h file and modify:
- modify the line:
with this value:
#include <SDL2_image/SDL_image.h>
#include <SDL2/SDL_image.h>
- save the file.
- modify the line:
-
-
Compile martin-the-martian project:
- Create folder "build"
- Enter the "build" folder
- Run
cmake ..
- Run
make
- Run
./VoidSample