• ■ The following projects come with absolutely no warranty of any kind.
  • ■ Whatever you do with this information is your own responsibility.
  • ■ Made for research and fun. Nothing else.
  • ■ All third-party git hosts are only used exclusively as a means to distribute the projects and are NOT the original development repos.

// Fully featured 2.5D rendering engine, multi platform and built for speed.
Made in crossplatform C++ and modern OpenGL(v3.3+).
Table of Contents
What is SkeletonGL?

SkeletonGL is a 2D rendering engine written in C++ with a focus on performance and flexibility, it offers a feature-complete, ready to use template to immediately begin working on the essential components of the application without having to first write an underlying foundation.

The engine is written in multiplatform C++ and relies exclusively on free and open libraries to provide everything a GPU accelerated program needs to deliver on the harshest standards. It's design abstracts away OpenGL's shortcoming by offering a dead simple interface to the engine's API together with an easily modifiable OpenGL 3.3+ wrapper that allows for specialized builds and effective debugging techniques.

All modern OpenGL rendering capabilities are available, making it a more complete alternative to SDL's 2D renderer while providing a very similar interface, it's just as easy to use but with the added benefit of everything a core graphics engine should. If you're looking for a complete, yet unobtrusive solution for graphical desktop development, SkeletonGL is for you.

  • ■ Updated for multiplatform C++20
  • ■ Full .INI configuration file parser
  • ■ Runs on both legacy and modern hardware
  • ■ Fully compatible with legacy systems like WindowsXP
  • ■ Integrated logging, and hardware profiling tools
  • ■ Specialized shader and OpenGL debugging
  • ■ Can be compiled for virtually any modern operating system
  • ■ Compatible with all modern (version 3.3+) OpenGL versions
  • ■ Simple yet fully featured 2D rendering
  • ■ GPU accelerated primitive geometry rendering (including circles!)
  • ■ Sprite and primitive batching
  • ■ Full access to both custom and default shaders
  • ■ Automated asset loading and management
  • ■ Support for TTF and Bitmap font rendering
  • ■ Texture atlas capabilities
  • ■ Deterministic (FPS limited) and uncapped rendering
  • ■ Included post-processor with custom shader support
  • ■ Lag free input system for mice, keyboards, gamepads and joysticks
  • ■ VSYNC options, window management and multi-monitor support
  • ■ Project template and makefiles included
  • ■ OpenGL blending modes for all renderers
  • ■ Tiny codebase, has five dependencies (all free)
  • ■ Doxygen commented, includes example programs
  • ■ Fully exposed OpenGL rendering pipeline for customized builds
SGL's initialization output

Engine status panel

Cellular automata simulator (CAS-SGL) running on SGL

Testing the instrance renderers (FPS lowered due to compression)
Software dependencies

The /skeletongl/deps/dep_credits.txt file includes the dependency's respective licenses.

  • GLM // All internal math (already included)
  • stb_image // Texture loading (already included)
  • FreeType // TTF font support
  • SDL2 // Window, OpenGL context creation and input events
  • GLEW // OpenGL extension loading library







Installation 1. Install the dependencies. For Debian / Ubuntu :

sudo apt-get install libsdl2-dev libglew-dev libfreetype6-dev

For Arch based systems:

sudo pacman -S sdl2 glew freetype2

2. Clone the SkeletonGL repo.

git clone https://git.xenobyte.xyz/XENOBYTE/skeletongl/


The source code is thoroughly documented using the doxygen standard, any doxygen generator can parse the code and output the API's specification into a portable format of your choosing.

The root folder contents are already setup as a template for new projects, simply add your own source code to the /src/ folder and update the makefile:

Root project folder
  • ■ src/: Source code folder
  • ■ static_lib: Compile the SGL into a static (.a) library
  • ■ static_exe: Statically compile the sgl.a lib into the final executable
  • ■ makefile: Dynamically compile the final executable
  • ■ skeletongl.ini: Runtime settings file

src/ code folder
  • ■ skeletongl/: SkeletonGL library source code
  • ■ skeletongl/skeletonGL.hpp: Monolithic include file
  • ■ skeletongl/window/: Window manager and main library interface
  • ■ skeletongl/renderer/: All render and OpenGL related code
  • ■ skeletongl/utility: Data structures, constants and general utility
  • ■ skeletongl/deps: Header only dependencies (GLM & stb_image)

Note that the entire SkeletonGL interface can be seen in the window/window.hpp file.

Example programs

The following programs are made in SkeletonGL and free for you to fuck tinker with.

// Example snake game for the SkeletonGL graphics library. Read more...

// Conway's game of life simulator made in SkeletonGL & C++ with a focus on performance. Read more...

F.A.Q. & Troubleshooting Is SkeletonGL crossplatform?

SkeletonGL was made for UNIX systems, however, because it's programmed in C++ and its dependencies are all crossplatform it can be compiled for anything that runs C++11, SDL2 and OpenGL 3. The plan is to officially release a Windows version in the future.

Why OpenGL?

Compatibility, despite having launched in 2008 it is also the most commonly supported OpenGL specification, specially in laptops. Because 2D games do not rely so heavily on modern hardware, they should be able to run on older machines.

Why SkeletonGL over SDL2, Allegro, SFML, etc...?

SDL2 and Allegro's included renderer lack OpenGL features (though SkeletonGL still uses SDL2 for window and OpenGL context management).
SFML's renderer is similar to what SkeletonGL offers, however SkeletonGL is far smaller and exposes the internal workings of OpenGL to allow for further modifications at the GPU level while still providing a simple API that doesn't clash with the aforementioned customizability.

What is the project's license? Do I have to pay or credit you in any way?

The project is MIT licensed and free.


For more information regarding development plans, updates and announcements visit the SkeletonGL devlog.


* ver 2.1 [ 25/01/2021 ]

  • - Updated comments, purged deprecated files

* ver 2.0 [ 09/12/2020 ] <-- CURRENT STABLE VERSION

  • - Added a GPU accelerated circles renderer and circle batch renderer
  • - Added CIRCLE_SHADER & CIRCLE_BATCH_SHADER to their shaders list
  • - Updated the uniforms parsed to the shaders of all the renderers
  • - Updated all default shaders
  • - Added a convenience overload to renderBMPFont()
  • - Replaced all string references to internal OpenGL and SkeletonGL objects with const references
  • - SKELETONGL_Renderer & SKELETONGL_PostProcessor purged of all prototype code, got some overall cleanup
  • - Added blending options to all render objects including circles
  • - All internal OpenGL value limits (pixel size, line width, max batch render size, etc) are now defined in SKELETONGL_DataStructures.hpp
  • - Default assets file paths and loading were updated
  • - Fixed a bug where default assets weren't being correctly loaded when trying to render with invalid / uninitialized values
  • - Passing a shader offer type BATCH render an individual entity or vice-versa (i.e. passing an SGL::DEFAULT_SPRITE_BATCH_SHADER to render a single sprite) no longer triggers an exception, it is possible to write custom hybrid shaders for both renderers

* ver 1.92 [ 05/11/2020 ]

  • - Rebranded comments NEOHEX.XYZ -> XENOBYTE.XYZ
  • - Deleted some old, sneaky trash files

* ver 1.9 [ 03/08/2020 ]

  • - Polished the instance renderers, they should work much faster now
  • - Added a limit of 10,000 items per call, see SKELETONGL_DataStructures.hpp to change it
  • - Added blending options to the SKELETONGL_Pixel, SKELETONGL_Line and their respective batch renderers
  • - Added new blending functions
  • - All instance renderers are now compatible with their base shaders (ie, sprite shaders work with sprite batching)
  • - The getTextureMemoryGPU function now includes the instance renderers pre-allocated memory
  • - Added a makefile / compile time macro to add or remove error checking after render calls
  • - SKELETONGL_Pixel can now specify pixel size
  • - SKELETONGL_Line can now specify line width
  • - ptimized away many unnecessary calls to OpenGL VBOs

* ver 1.7 [ 29/07/2020 ]

  • - Added a width specifier to the SKELETONGL_Line and its respective batch renderer
  • - Cleaned a few comments
  • - Added const and noexcept correctness to the library, the interface is complete

* ver 1.6 [ 10/05/2020 ]

  • - Uninitialized SKELETONGL_Sprites now render the internal default texture instead of throwing an error
  • - Added a constant for the default texture name
  • - Added support for both SGL blending modes and raw, OpenGL enum source and destination factors

* ver 1.5 [ 05/05/2020 ]

  • - Fixed grammar, comments

* ver 1.4 [ 02/05/2020 ]

  • - Updated GLM to v0.9.9.0
  • - Updated stb_image to ver 2.5
  • - Added a filter to the stdout calls by SKELETONGL_Log
  • - Updated the makefiles
  • - Manually initialized all internal glm::vector & glm::mat
  • - Included a file with the dependencies and their licenes in deps/

* ver 1.3 [ 25/04/2020 ]

  • - Remove many profiling crap, the internal SKELETONGL_Window delta time measures the time between renders ONLY
  • - Removed useless helper functions
  • - While working on Risk Vector I added a proper fixed time-step updating to the physics

* ver 1.23 [ 19/04/2020 ]

  • - Added a bitmap font renderer to the SKELETONGL_Renderer class
  • - Fixed some minor input bugs

* ver 1.22 [ 10/04/2020 ]

  • - Added "pressed" and "released" status checkings to the mouse buttons
  • - Fixed some comments
  • - Fixed a bug where the windows wasn't respecting the .ini file fullscreen request

* ver 1.21 [ 20/03/2020 ]

  • - Added dynamic VSYNC toggling
  • - Added an alternative orthographic projection with the Y axis flipped

* ver 1.2 [ 0/02/2020 ]

  • - Deleted test files (sgl/src/), will be making a separate git for testing.
  • - Fixed an input bug were unhandled signals where causing spontaneous SDL_QUIT events.

* ver 1.1 [ 20/01/2020 ]

  • - Added instance rendering (sprite batching) to the sprite, pixel and line renderers
  • - Removed a few, minor bugs.

* ver 1.0 [ 31/11/2019 ]

  • - Moved the project to a new git
  • - Removed a few useless files
  • - Since SkeletonGL already has a stable release, the git has been reset