Currently browsing tag

GLUT

GLUT-Tutorial

How to detect a Mouse Click and Mouse Motion

  Detecting Mouse Click GLUT provides a function glutMouseFunc which is responsible for detecting mouse click generated by a program. Its syntax is void glutMouseFunc(void (*func)(int button, int state, int x, int y)); Where, func –> Function that handles the mouse event i.e. when mouse click is detected, func is …

Font rendering in GLUT using bitmap fonts with Sample example

Font rendering in GLUT using bitmap fonts with Sample example. GLUT supports two type of font rendering: stroke fonts, meaning each character is rendered as a set of line segments; and bitmap fonts, where each character is a bitmap generated with glBitmap. Stroke fonts have the advantage that because they …

GLUT Tutorial Creating Menus and Submenus in GLUT

GLUT Tutorial – Creating Menus and Submenus in GLUT GLUT supports simple cascading pop-up menus. They are designed to let a user select various modes within a program. The functionality is simple and minimalistic and is meant to be that way. Do not mistake GLUT’s pop-up menu facility with an …

Rendering Teapot glutSolidTeapot and glutWireTeapot using GLUT in C

Rendering Teapot glutSolidTeapot and glutWireTeapot using GLUT in C GLUT provides function glutSolidTeapot to render a Solid Torus and glutWireTeapot to render a Wire Frame Torus. glutSolidTeapot and glutWireTeapot render a solid or wireframe teapot respectively. Both surface normals and texture coordinates for the teapot are generated. The teapot is …

Rendering Torus glutSolidTorus and glutWireTorus using GLUT in C

Rendering Torus glutSolidTorus and glutWireTorus using GLUT in C GLUT provides function glutSolidTorus to render a Solid Torus and glutWireTorus to render a Wire Frame Torus. glutSolidTorus and glutWireTorus render a solid or wireframe torus (doughnut) respectively centered at the modeling coordinates origin whose axis is aligned with the Z …

Rendering Cones glutSolidCone and glutWireCone using GLUT in C

Rendering Cones glutSolidCone and glutWireCone using GLUT in C GLUT provides function glutSolidCone to render a Solid Cone and glutWireCone to render a Wire Frame Cone. glutSolidCone and glutWireCone render a solid or wireframe cone respectively oriented along the Z axis. The base of the cone is placed at Z …

GLUT Tutorial Handling Keyboard Events

GLUT Tutorial – Handling Keyboard Events Almost all of the games use Keyboard to control the objects i.e. to move, jump, turn, slide etc.  Keyboard events is essential part of game programming. All game development libraries support Keyboard Handling. GLUT also has nice and simple functions that provide the facility …

GLUT Tutorial 2D Animation

GLUT Tutorial: 2D Animation This is the second tutorial on GLUT. In this tutorial I am going to show you how to do a 2D animation in GLUT. There are various methods that can be used to animate an object in GLUT. Among them, I will use a simple method …

GLUT Tutorial Drawing Basic Shapes Triangle and Rectangle

GLUT Tutorial: Drawing Basic Shapes (Triangle and Rectangle) This is the first tutorial on GLUT. In this tutorial I am going to show you how to draw basic 2D shapes like triangle and rectangles using OpenGL. Although OpenGL is basically made for 3D programming, drawing 2D shapes gives the basic …

Start Building 3D games Using OpenGL Utility Toolkit GLUT

Start Building 3D games Using OpenGL Utility Toolkit (GLUT) GLUT (pronounced like the glut in gluttony) is the OpenGL Utility Toolkit, a window system independent toolkit for writing OpenGL programs. It implements a simple windowing application programming interface (API) for OpenGL. GLUT makes it considerably easier to learn about and …

How to setup GLUT in CodeBlocks IDE

How to setup GLUT in Code::Blocks IDE To setup a OpenGL Utility Toolkit (GLUT) in your Code::Blocks IDE, follow the following procedures. Make sure the Code::blocks IDE is installed. First of all you need to download a GLUT library. For this CLick Here Copy the glut. h in downloaded folder …