Game Development Reference
In-Depth Information
How to do it…
1.
We split all our code into several logical subsystems and put them into the
following folders:
core : This has low level facilities, such as the intrusive smartpointer and
math library
fs : This contains filesystem related classes
GL : This contains the official OpenGL headers
include : This contains the include files of some third-party libraries
graphics : This contains high-level graphics-related code, such as fonts,
canvas, and images
LGL : This contains our OpenGL wrapper and functions-loading code together
with the abstraction layer implemented in Chapter 7 , Cross-platform UI and
Input System
Sound : This contains audio-related classe and decoding libraries
threading : This contains multithreading-related classes, including
mutexes, events, queues, and our multiplatform threads wrapper
How it works…
Most of the code in each folder is split into classes. In our minimalistic gaming engine, we
keep the number of classes to a reasonable minimum.
The graphics folder contains the implementations of the following structs and classes:
F Struct sBitmapParams holds the parameters of the bitmaps, such as width, height,
and pixel format.
F Class clBitmap is an API-independent representation of a bitmap that holds actual
pixel data together with sBitmapParams . It can be loaded into a clGLTexture.
F Class clCanvas provides a mechanism for immediate rendering.
F Class clVertexAttribs is an API-independent representation of 3D geometry. It
can be loaded into a clGLVertexArray .
F Class clGeomServ provides 3D geometry creation methods that return
clVertexAttribs .
F Class iGestureResponder is an interface to be implemented if you want to
respond to touches or gestures.
F Structure sMotionData holds the current set of active touch points.
F Class clTextRenderer provides FreeType-based text rendering facilities. It can
render a text string with a speciied font into a clBitmap .
 
Search WWH ::




Custom Search