SimpleGL
1.1.0
A framework for platform independent rendering
|
This is the documentation of the SimpleGL project. You can find the repository of this framework here.
SimpleGL is licensed under the MIT License, which can be found here.
This framework has some external depenencies, before using it you should get the following third party libraries:
For the OpenGL backend you also need the following third party libraries:
Follow the installation guides of these libraries.
For using the Vulkan backend you should have the Vulkan SDK installed.
After installing the third party libraries you should get the source code of this repository. You can download the current code by clicking here or by cloning this repository with Git.
This project is using CMake for generating project files or Makefiles. You need at least version 3.0.2 for compiling. After generating the files just compile it with your chosen compile environment like MinGW, Visual Studio or GCC.
The CMake file offers some options for the compilation.
BUILD_SHARED_LIBS
dethermines whether SimpleGL is build as shared library or as a static library. Default is ON
.SimpleGL_BUILD_EXAMPLES
determines wheter the example applications are built along with the library. Default is ON
.SimpleGL_BUILD_DOCUMENTATION
determines wheter the Doxygen documentation is built along with the library. Default is OFF
.Alternatively you can get the precompiled Windows source here. Note that this is currently a legacy version of the library which will only work on Windows systems.
The installation will be done by the generated CMake build files for example by calling make install
or running the INSTALL
project in Visual Studio. You can configure the installation directory by setting the CMAKE_INSTALL_PREFIX
variable when generating the build files.
${CMAKE_INSTALL_PREFIX}/SimpleGL/lib
.${CMAKE_INSTALL_PREFIX}/SimpleGL/bin
and its import library in ${CMAKE_INSTALL_PREFIX}/SimpleGL/lib
.${CMAKE_INSTALL_PREFIX}/SimpleGL/include
.In the first step you need to create a C++ application. In the application project you have to create a reference to the framework.
${CMAKE_INSTALL_PREFIX}/SimpleGL/include
to your project include directories.${CMAKE_INSTALL_PREFIX}/SimpleGL/lib
to your linker.${CMAKE_INSTALL_PREFIX}/SimpleGL/bin
or copy it to your project's run directory.With those prerequisites done you can create the source code now. For using the framework you need to extend a class with sgl::ApplicationGL
if you want to use the OpenGL backend or sgl::ApplicationVK
when using the Vulkan backend. The header file should look more or less like this:
In the corresponding source file you implement a method for drawing, the source file should look somewhat like this:
Now you need a main
method to start the application. Your main file just needs to start the application:
If everything is alright you should see a three-colored triangle.