Robadob / sdl_exp

Low-level graphics engine built over SDL2
MIT License
1 stars 2 forks source link
opengl shaders

SDL_EXP

A simple template implementation using SDL for quickly applying the modern OpenGL pipeline to projects.

Usage

The easiest way to utilise this library appears to be:

Shader Uniforms & Attributes

The Shaders, Entity and Model objects attempt to automatically manage uniforms and attributes, you can assist their functioning by using the below naming schemes for your uniforms and vertex attributes. Each shader object should only be attached to a single entity, otherwise their bindings will all be shared. You can also configure your own static and dynamic uniform floats and ints by calling addStaticUniform() and addDynamicUniform() on the relevant Shaders object.

Optimus Support

It's possible to force laptops with Optimus hybrid graphics to handle this application with the dedicated GPU by building with the preprocessor macro FORCE_OPTIMUS, this is disabled by default to better facilitate testing on Intel integrated.

CUDA-GL interop

The header visualisation/util/cuda.cuh provides functionality for allocating and freeing OpenGL texture buffers that can be accessed by CUDA. If you wish to write to these textures asynchronously of their accesses by shaders it is recommended you use some form of locking. The header was initially written for use with the CUDA 7.5 API.

In order to enable CUDA compilation/support in the project you must follow these steps:

Usage:

Additional Usage:

Dependencies

All dependent libraries are included within the repo, licenses are available on their respective websites.