-
Notifications
You must be signed in to change notification settings - Fork 1
/
devLog.txt
37 lines (27 loc) · 1.32 KB
/
devLog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Build command @ Terminal for Linux
added optimization (20 seconds on Terminal)
g++ -o altayTerm Altay.cpp -lX11 -lGL -lpthread -lpng -lasound -lstdc++fs -std=c++17 -O3
alternative:
g++ -o altayTerm Altay.cpp -lX11 -lGL -lpthread -lpng -lstdc++fs -std=c++17 -Ofast
game plays at 20fps on my Linux VirtualBox (Pardus, 2GB RAM, 3d Acceleration ON.).
to install olcPixelGameEngine dependencies on Linux:
sudo apt install build-essential libglu1-mesa-dev libpng-dev
to install ALSA sound libraries
sudo apt install libasound2-dev
To build the game on Windows, check Javidx9's videos (e.g. use Visual Studio 2019 Community Edition)
++ added Timer (thx Cherno) to see how long a function takes.
float distance(const float x1, const float y1, const float x2, const float y2) {
Timer timer;
return (x2 - x1) * (x2-x1) + (y2 - y1) * (y2 - y1);
}
Drawing the whole screen is the bottleneck for Linux.
[] Maybe worth Using decals? Possible?
Timing certain parts of the code:
// Altay includes performance measurement functionality.
// Cherno style, ref: https://www.youtube.com/watch?v=YG4jexlSAjc
// Usage: instantiate a Timer struct inside the scope you want to measure.
// upon exit from scope, it will output the time diff to the console.
{
Timer timer;
DrawSprite(0, 0, buffBack); //this is the bottleneck for Linux.
}