How to Install and Run OpenGL on Ubuntu OS

in #dtube5 years ago


Open Bash(Shortcut---ctrl+Alt+T)
For NewBies Bash is for Ubuntu like DOS is for Windows(Command Line Interface)
Step 1:
Command to install OpenGL on Ubuntu:
sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev

Note:Running sudo command will ask you for the password.It is the mostly same as the Login Password.

Step 2:Put the opengl code in file with extension of .c(i.e a C program file)
Note:"gedit" is the default text editor.Write out the code in "gedit".To open the text editor write the gedit in the Bash.

Command to Compile and Run a Opengl file:
If you have saved the file as lol.c then wite out this command in the Bash.
gcc -o lol lol.c -lGL -lGLU -lglut

Then to run the file u need to use the following Commands
./lol(Dot Slash filename)


▶️ DTube
▶️ YouTube

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 59986.17
ETH 2417.93
USDT 1.00
SBD 2.45