The document provides an overview of OpenGL, a widely used 3D graphics API, and instructions for installing it on the Ubuntu operating system. It discusses the OpenGL Utility Toolkit (GLUT), which simplifies OpenGL programming by handling system-level I/O and window management. Additionally, a basic program example is included to demonstrate the use of OpenGL primitives for rendering graphics.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
9 views6 pages
cg p 1 odd pages
The document provides an overview of OpenGL, a widely used 3D graphics API, and instructions for installing it on the Ubuntu operating system. It discusses the OpenGL Utility Toolkit (GLUT), which simplifies OpenGL programming by handling system-level I/O and window management. Additionally, a basic program example is included to demonstrate the use of OpenGL primitives for rendering graphics.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6
Title: Install and explore the OpenGL
Aim: To study briefly about OpenGL and to install OpenGL on the UBUNTU Operating System.
Theory:
OpenGL is the most extensively documented 3D graphics API(Application
Program Interface) to date. Information regarding OpenGL is all over the Web and in print. It is impossible to exhaustively list all sources of OpenGL information. OpenGL programs are typically written in C and C++. One can also program OpenGL from Delphi (a Pascal-like language), Basic, Fortran, Ada, and other languages. To compile and link OpenGL programs, one will need OpenGL header files. To run OpenGL programs one may need shared or dynamically loaded OpenGL libraries, or a vendor-specific OpenGL Installable Client Driver (ICD). GLUT: The OpenGL Utility Toolkit (GLUT) is a library of utilities for OpenGL programs, which primarily perform system-level I/O with the host operating system. Functions performed include window definition, window control, and monitoring of keyboard and mouse input. Routines for drawing a number of geometric primitives (both in solid and wireframe mode) are also provided, including cubes, spheres, and cylinders. GLUT even has some limited support for creating pop-up menus. The two aims of GLUT are to allow the creation of rather portable code between operating systems (GLUT is cross-platform) and to make learning OpenGL easier. All GLUT functions start with the glut prefix (for example, glutPostRedisplay marks the current window as needing to be redrawn) Setting up GLUT - main() GLUT provides high-level utilities to simplify OpenGL programming, especially in interacting with the Operating System (such as creating a window, handling key and mouse inputs). The following GLUT functions were used in the above program: ● glutInit: initializes GLUT, must be called before other GL/GLUT functions. It takes the same arguments as the main(). void glutInit(int argc, char *argv[]) ● glutCreateWindow: creates a window with the given title. glutCreateWindow(char *title) //Basic program to display output using basic OpenGL primitives #include<GL/glut.h> #include<iostream> using namespace std; void initialize() { glClearColor(1, 1, 1, 1); glClear(GL_COLOR_BUFFER_BIT);