-
Notifications
You must be signed in to change notification settings - Fork 3
Source Code Structure
All Topaz modules share a similar source code structure. However, some are more complicated than others.
All source code needed to build the engine can be found within Topaz/src. Includes are not separated.
Core libraries can be found within the top-level tz
namespace. All of which can be found within Topaz/src/core. Behaviour such as windowing, mathematics, memory and containers can all be found here.
Topaz core is richly documented, you can find the documentation for the core libraries here.
The graphics library is the most complicated module, because it has platform-dependent code. At present, Topaz supports the following graphics APIs:
- OpenGL 4.5
- Vulkan 1.2
The graphics library exposes a high-level interface via the tz::gl
namespace. In addition, each graphics API has its own frontend and backend implementation. These are also documented but are not user-facing, those using the engine only need concern themselves with the public API.
The public API can mainly be found in Topaz/src/gl/api. This includes renderers, devices and resources. However, specific larger features are not implemented here. The rest of that can be found above the api directory in src/gl.
If you intend to understand the graphics library on a deeper level, read on. Otherwise, you need not read this section.
The API is predominately for renderers, devices and resources. Each of these have their own implementations in the graphics API frontend. For example, the implementation for these for OpenGL can be found within Topaz/src/gl/impl/frontend/ogl2.
The backend is completely separate from tz::gl
and acts more of an abstraction around each graphics API. These can be found in the backend subdirectory in the tz::gl::ogl2
and tz::gl::vk2
namespaces. If a new graphics API is to be supported, creating the backend would be the first step on adding support. The frontend has the responsibility of using the backend to implement the public-facing tz::gl
API.