User guide

3.10. THE GL GRAPHICS LIBRARY 97
GET "libhdr"
MANIFEST { g_sdlbase=nnn } // Only used if the default setting of 450 in
// libhdr is not suitable.
GET "sdl.h"
This lib rar y is currently described i n Chapter 4 of bcpl4raspi.pdf available from my
home page.
3.10 The GL Gra phi cs Libr ar y
This library is still under development
OpenGL is a sophisticated graphics library allowing 3D images to be drawn on
the screen efficiently using the full power of the graphics har dware available on most
machines. On most desktop and laptop machines the full OpenGL library is available,
but on handheld devices only a si m pl i fie d version called OpenGL ES is available. The
BCPL interface i s designed to work with whichever version of OpenGL is availabl e .
This library essentially provides a subset of the OpenGL ES features. Note that the
GL interface on the Raspberry Pi uses OpenGL ES.
To include these features in cintsys it is necessary to install the OpenGL li-
braries on you machine and then build cintsys using a Makefile such as MakefileGL,
MakefileRaspiGL or MakefileVCGL.
The GL library uses the sys(Sys
gl,...) functions. There is a header file
(g/gl.h) declaring the various constants and globals available in the GL library, and
g/gl.b contains the definitions of several functions providing the interface to Op e nG L.
The constant g
glbase is set in libhdr to be the first global used in the GL library.
It can be overridden by re-de fini ng g
glbase after GETting libhdr.
A program wishing to use the OpenGL library should start with the following lines.
GET "libhdr"
MANIFEST { g_glbase=nnn } // Only used if the default setting of 450 in
// libhdr is not suitable.
GET "gl.h"
GET "gl.b" // Insert the library source code
.
GET "libhdr"
MANIFEST { g_glbase=nnn } // Only used if the default setting of 450 in
// libhdr is not suitable.
GET "gl.h"
This library will be described in Chapter 5 of bcpl4raspi.pdf available from my home
page.