Skip to content

General-purpose, 3D-oriented OpenGL graphics library in progress.

License

Notifications You must be signed in to change notification settings

Epsylene/Sirius

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sirius

downloads version

Sirius logo

A window containing several panels with options and a scene containing objects.

Introduction

Sirius is a general-purpose, 3D-oriented graphics library based on OpenGL. Its main focus is on 3D rendering, but there really can be anything interesting related to computer graphics and simulations, as I use it to learn things from those fields. As such, its features and structure may be (are) lacking, but I do my best to improve it and give it proper attention !

Installation

Getting started

The library is untested on any development environment other than Windows with MinGW-w64. C++20 support is required.

Building from sources

To build the library, you will first have to make sure that you have the last version of CMake installed on your computer. If that isn't the case, you can download the binaries here.

Then, you will have to download the library sources. You can click on the Code button on the upper-right corner and either download the repository's ZIP file, or clone it with the following commands:

git clone https://github.com/Epsylene/Sirius.git
cd Sirius
git submodule init
git submodule update

Then you have to tell CMake to generate the configuration files for your compiler, as well as the installation prefix for the library files. You can do it with the CMake GUI, or via the CLI. In the last case, the command looks like this:

cmake -G "GENERATOR" SOURCE_DIR

You have:

  • GENERATOR: determines for which compiler the makefiles are going to be generated (on Windows, if you are using MinGW or MinGW-w64, type "MinGW Makefiles"; if you are using Visual Studio, you can search for your version's CMake generator, but it should be the one chosen by default);

  • SOURCE_DIR: the path of the cloned repository's folder;

  • GEN_DIR: the directory where you want to generate your build files.

After that, the last thing you have to do is to run this command:

cmake --install BUILD_DIR --prefix INSTALL_DIR

Where:

  • BUILD_DIR is the directory where the cmake_install.cmake file is located ;

  • INSTALL_DIR is the directory where you want to install the library.

If you got no errors, then, congratulations ! You have succesfuly installed the library.

Linking the library

All you need is in the library install path. Copy-paste it into your project, and add the following lines to your CMakeLists.txt:

add_definitions(-DGLFW_INCLUDE_NONE)

add_subdirectory(lib/Sirius)

target_link_libraries(${YOUR_TARGET} Sirius)
target_compile_definitions(Sirius PUBLIC -DSRS_APP_DIR=${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(${YOUR_TARGET} PUBLIC ${SIRIUS_INCLUDE_DIRS})

Finally, go to "Sirius/bin", grab the libSirius.dll, libassimp.dll files, and paste them next to your executable (or copy them with the CMake copy functions that you can find in the example app/CMakeLists.txt).

Credits

The library's core features were at first derived from The Cherno's Game Engine series, which is a great ressource not only on the technicalities of a game engine, but also the design issues that are faced when writing a library. On the other hand, Joey de Vrie's Learn OpenGL has been extremely useful to understand the OpenGL concepts and objects I wanted to implement. Make sure to go check both !

Sirius uses OpenGL, glad, GLFW, Assimp, Dear ImGui, stb_image, magic_enum, fmt and glm.