|
about sGL
sGL is a C++ wrapper built around OpenGL.
OpenGL is a platform independent Graphics Library built
originally in C. Accompanied with OpenGL dedicated
hardware it is an extremely powerfull library; and is
becoming an industry standard in Graphic softare developement.
However OpenGL being a very powerfull C library is quite
complex, and hard to understand and to use. Furthermore the
concept of a functional language is counter-intuitive
to a medium revolving around object design (object in the
literal sense of the word.)
Thus sGL, Structured Graphics Library, was developed
by Santiago V. Lombeyda, as an Object Oriented interface
allowing easy access to creation and control of objects as
provided in OpenGL.
sGL allows a user to create a scene in fewer than 20
lines of code, which may have easily taken 5 to ten times
as much using pure OpenGL. Furthermore, because of the innate
object oriented cabailities of C++ (inheritance, polymorphism)
a semi-experienced porgramer may expand sGL, adding
new object bases, as well as linking, scripting, animating, or
even viewing capabilties.
It is easily concievable that even games (i.e. pool) could be
developed easily with the aid of sGL. And, due to the
platform independent base of sGL and OpenGL, code
may be ported and recompiled under any platform.
|
|
how to use
Once you have downloaded the required
files. using sGL is quite simple. First start by becoming familiar with
the sGL api. Then follow the below
describe procedure (some steps may only need to be performed
once):
- With all requirements fullfilled, first edit the Makefile. In it
you will find several paths which may need to be changed according
to you system and environment. Such dependencies include:
- available C++ compiler: correct the path for
your preferrec C++ compiler.
- OpenGL Include Directory: set the path were
the OpenGL include files are locatee (i.e. gl.h, glu.h, glut.h)
- library paths Make sure that you have
set your enviroment paths correctly so that when compiling
your scene, the Makefile will be able to find
all included libraries. Such libraries include the math
library m, system libraries
(default x-windows), and OpenGL libraries (GL, GLU; default Mesa
libraries MesaGL, MesaGLU).
- scene file names: by default it is assumed that
the file name being used to descibe your scene is
called scene.cpp, with the executable being
created and named scene. You may change this
to whichever is your preference.
- Edit your scene file according to legal
sgl api and OpenGL commands,
functions, and operations.
- Compile your scene. Type make, make scene, or make all. If your have made changes to the
sgl.h, sgl_shapes.h, or slg_links.h you may want to clean
all object files using make
clean before recompiling.
If you get compilation erros, make sure that you
have no spelling mistakes (typos,) that you are using
the correct form of the constructors/methods. If you
need further assistant, you may contact the deveoper
pf sGL at help
- Execute your scene. If you are using the
provided sgl class, then you may cruise around your
world! Enjoy!
|