Review: c't 14/97
German Computer Magazine

Deutsch

Page 80:
Instant-Windows
Easy programming of GDI and OpenGL

A wonderful utopia: Use the GDI and OpenGL functions of Win95 and Win NT, without complex system programming. SceneLib makes the dream come true.

 

Author: Arndt Kraft  (English Translation: M. Hudritsch)

SceneLib is a C/C++ Library for Win32. It implements a standalone window handling with parallel running threads and provides the functionality to display 2D and 3D graphics. SceneLib takes over the entire event handling for 'its' windows. This way you can use rapidly and easily the graphics commands without bothering the Windows programming. The following code would be enough to bring a sphere on the screen:

#include "SceneLib.h"
void main()
{ void *w = swCreateWind(" SceneLib: Hello 3D World");
  void *s = swCreateScene(w);
  snSphere(NULL,1,32,32,32,32,SL_OUTSIDE,tex);
  swShowWind(w);
  char ch=getch();
}

SceneLib uses the Windows graphics library GDI and OpenGL. I encapsulates the functions and leads the output to the according window. You can combine the functions however you like. The 2D node start to flicker as soon you rotate a 3D scene. This can't be avoided because the GDI graphics (2D) are viewed after OpenGL has swapped its drawing buffer.

In the 2D part you can draw for example lines, circles, rectangles as well as change pens and brushes. Internally SceneLib is storing the graphic command as an node list, that is worked through automatically each time the window needs to be repainted. The main point is, that this is done even while the main program (main thread) is waiting for keyboard input with getch().

But the more interesting part of the library is the 3D capability. The important OpenGL commands are available a s well as some more complex functions that allow the drawing of spheres, cubes and cones. SceneLib provides not only a static view of the nodes. It also allows the user to zoom or move the scene with the mouse or the keyboard. You can choose from different modes to rotate, fly or walk through the scene.

The click on the right mouse button shows a context menu where you can set among other modes the drawing mode for filled, wired or pointed drawing style. In two dialogs you can set the viewing position and up to eight light sources.

The commands are held in standard C, though SceneLib is internally built up node oriented. The conception itself is open and can be extended by the user with C++.

The Library contains DLLs and import libraries for Borland and Microsoft C++ compilers as well as numerous example applications. The documentation consists of graphically and contextually well done HTML pages. The program is shareware but contains no restrictions in functionality; there are only shareware messages in the status bar and while opening a graphic window. After the end of a 60 day evaluation period the number of nodes will be limited to 60.

SceneLib is constantly in development. The current version (1.04) has little inconstancies. The function ClearWind e.g. has not yet found its way into the documentation. Also there are so far no functions to retrieve information about mouse position in the graphic window. But this doesn't change the extraordinary impression about SceneLib. One also has to point out the immediate support from the author. And when he implements all announcements of his to do list such as a compatible UNIX version, SceneLib will get even better. All in all SceneLib is more than only one look worth. (jm)