0% found this document useful (0 votes)
105 views3 pages

Introduction to OpenGL API Basics

OpenGL is an API for 3D graphics rendering. It consists of a set of functions that can be called from a program. There are several levels of abstraction in OpenGL including GL for low-level vertex and matrix manipulation, GLU for helper functions like perspective projections, and GLUT for window and interface management. OpenGL implementations provide platform-specific libraries for Windows, Linux, etc. OpenGL programs typically run in an event loop to handle user input and window events. OpenGL commands start with "gl" and constants start with "GL_". Commands indicate the number and type of arguments using letters like "f" for float.

Uploaded by

Gayathri Das
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
105 views3 pages

Introduction to OpenGL API Basics

OpenGL is an API for 3D graphics rendering. It consists of a set of functions that can be called from a program. There are several levels of abstraction in OpenGL including GL for low-level vertex and matrix manipulation, GLU for helper functions like perspective projections, and GLUT for window and interface management. OpenGL implementations provide platform-specific libraries for Windows, Linux, etc. OpenGL programs typically run in an event loop to handle user input and window events. OpenGL commands start with "gl" and constants start with "GL_". Commands indicate the number and type of arguments using letters like "f" for float.

Uploaded by

Gayathri Das
Copyright
© © All Rights Reserved
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

Introduction to openGL

OpenGL is an API. OpenGL is nothing more than a set of functions you call from
your program (think of as collection of .h file(s)).

OpenGL Libraries
OpenGL
Application
GLU

GL

GLUT

GLX

Frame Buffer
Display

OpenGL Hierarchy:
Several levels of abstraction are provided
GL
Lowest level: vertex, matrix manipulation
glVertex3f(point.x, point.y, point.z)
GLU
Helper functions for shapes, transformations
gluPerspective( fovy, aspect, near, far )
gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);
GLUT
Highest level: Window and interface management
glutSwapBuffers()
glutInitWindowSize (500, 500);

OpenGL Implementations:
OpenGL IS an API (think of as collection of .h files):
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
Windows, Linux, UNIX, etc. all provide a platform specific
implementation.
Windows: [Link] [Link] [Link]
Linux: -l GL -l GLU l GLUT
Event Loop:

OpenGL programs often run in an event loop:


Start the program
Run some initialization code
Run an infinite loop and wait for events such as
Key press
Mouse move, click
Reshape window
Expose event

OpenGL Command Syntax (1) :

OpenGL commands start with gl


OpenGL constants start with GL_
Some commands end in a number and one, two or three letters at the
end (indicating number and type of arguments)
A Number indicates number of arguments
Characters indicate type of argument

OpenGL Command Syntax (2)


`f' float
`d' double float
`s' signed short integer
`i' signed integer
`b' character
`ub' unsigned character
`us' unsigned short integer
`ui' unsigned integer

You might also like