Sunday, May 6, 2018

Creating OpenGL application in Linux

I decided to start coding graphics for Linux
My system is Mint KDE 18.03 I just started using it.
I think, here is an easies way to start.

Packages, you need:

GLFW
Creates window, gets data from mouse and keyboard.

GLEW
Extension wrangler for OpenGL. GL commands are impossible to read and understand.

g++ - GNU C++ compiler


Let`s install them!

sudo apt install g++ libglew-dev libglfw3-dev

IMPORTANT!
write in terminal:
LD_LIBRARY_PATH=/usr/local/lib
sudo ldconfig
 


lets copy the triangle drawing code from learnopengl.com

Paste it in your file main.cpp, that you created in your project folder (for example Program/opengl-gcc).

COMPILE
g++ -std=c++14 main.cpp -lglfw -lGL -lGLEW
(C++ 11/14/17 features are turned off by default, so we must write -std=c++14, otherwise compiler will not understand, what nullptr is.)

RUN

./a.out

... ??
Profit!


1 comment:

  1. опиши, как устанавливал Packages, you need

    ReplyDelete

Dreamfly

Alongside with BeamTheGame, me and Dmytro Makarenko develop the DreamFly (Steam link here) game. If you have VR headset with motion c...