Chapter 1. What is SGL?

Table of Contents

1.1. Motivation for the SGL
1.2. SGL Audience
1.3. SGL License

SGL stands for Simple Graphics Library. It is an object-oriented C++ library thinly wrapping GLUT, Mark Kilgard's OpenGL Utility Toolkit library. The SGL provides a simple interface to GLUT/OpenGL graphics that is suitable for beginning programmers wishing to explore two-dimensional computer graphics. It is cross platform and extremely lightweight. The SGL does simple graphics well, but, due to its simplicity, it is not well suited for building sophisticated graphical user interfaces.

1.1. Motivation for the SGL

One disadvantage of C++ is that it currently lacks a standard graphics library. By comparison, languages such as Java and C# include in their standard libraries a rich set of graphics and graphical interface functionality. Several third-party C++ graphics libraries exist with varying degrees of cross-platform compatibility. The major ones include wxWidgets, FLTK, GTK+, and Qt. These libraries emphasize graphical user interface components, while others, such as OpenGL, and GLUT, focus on pure 2-D and 3-D graphics with less concern for the GUI. Libraries similar to the SGL providing C++ support for OpenGL include the GLOW Toolkit, GLUI, GLT, and GLUTMASTER. These frameworks are geared toward advanced 3-D OpenGL developers.

These full-featured libraries are quite complex and have a steep learning curve, especially for novice programmers. In addition to the programming complexity, some of these libraries can be difficult to install and set up by those with limited computer administration experience. Beginning programmers need a relatively simple collection of routines with which they can experiment with computer graphics, and the process to prepare their development environment to able to use the library must be relatively simple. A freshman university student using Microsoft Visual Studio, for example, should be able to quickly and easily set up the library and begin coding.

The graphics library should be cross platform so that a student developing on an Apple Macintosh running macOS or on a PC running Linux can compile and run their source code in a university lab running Visual C++ under Microsoft Windows, or vice versa.

It should be easy to write a simple program. Creating an empty window on the screen should not require 50 lines of source code. The SGL hides the details of OpenGL/GLUT code, providing a simpler interface for application programmers. Even though SGL client code ordinarily is oblivious to GLUT, an SGL client additionally can include GL/glut.h and directly access all the desired GLUT and OpenGL functionality.


Copyright  ©2019 Richard L. HaltermanVersion 0.9.5February 17, 2019
Creative Commons License This work is licensed under a Creative Commons License.