NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
glBoxDemo.nxc

This is an example of how to use the glInit, glBeginObject, glBegin, glAddVertex, glEnd, glEndObject, glSetAngleX, glBeginRender, glAddToAngleY, glCallObject, and glFinishRender functions.

/*------------------------------------------------------------------------------
; File : glBoxDemo.nbc
; Description : A program demonstrating a 3D box...
; Programmed by : Arno van der Vegt, avandervegt@home.nl
;-----------------------------------------------------------------------------*/
task main()
{
// Initialize the 3D engine...
glInit();
// Create a cube, this is the first object which will be object id 0...
glBox(GL_POLYGON, 20, 30, 40);
// Set the main view x-angle...
while (true)
{
// Rotate the main view....
// Setup for rendering...
// translate object 1
// Call the object with id 0...
// Finish, clear the screen, rotate and render the called objects...
}
}