Skip to content
forked from LukasBanana/LLGL

Low Level Graphics Library (LLGL) is a thin abstraction layer for modern graphics APIs such as OpenGL, Direct3D, and Vulkan

License

Notifications You must be signed in to change notification settings

CocoaGrylls/LLGL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,057 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status

Low Level Graphics Library (LLGL)

License

3-Clause BSD License

Documentation

Progress

  • Version: 0.01 Beta
 Renderer  Progress  Remarks
OpenGL ~85%
Direct3D 11 ~85%
Direct3D 12 ~5% Experimental state; Tutorials working: 01, 06, 07
 Platform  Progress  Remarks
Windows 100% Tested on Windows 10
Linux 50% Tested on Kubuntu 16; Anti-aliasing is currently not supported
macOS 50% Tested on macOS Sierra; Not all tutorials are running
iOS 1% Currently not compilable

Thin Abstraction Layer

// Interface:
CommandBuffer::DrawIndexed(unsigned int numVertices, unsigned int firstIndex);

// OpenGL Implementation:
void GLCommandBuffer::DrawIndexed(unsigned int numVertices, unsigned int firstIndex)
{
    glDrawElements(
        renderState_.drawMode,
        static_cast<GLsizei>(numVertices),
        renderState_.indexBufferDataType,
        (reinterpret_cast<const GLvoid*>(firstIndex * renderState_.indexBufferStride))
    );
}

// Direct3D 11 Implementation
void D3D11CommandBuffer::DrawIndexed(unsigned int numVertices, unsigned int firstIndex)
{
    context_->DrawIndexed(numVertices, firstIndex, 0);
}

// Direct3D 12 Implementation
void D3D12CommandBuffer::DrawIndexed(unsigned int numVertices, unsigned int firstIndex)
{
    commandList_->DrawIndexedInstanced(numVertices, 1, firstIndex, 0, 0);
}

// Vulkan Implementation
void VKCommandBuffer::DrawIndexed(unsigned int numVertices, unsigned int firstIndex)
{
    vkCmdDrawIndexed(commandBuffer_, numVertices, 1, firstIndex, 0, 0);
}

Tutorials and Examples

This repository contains several tutorials and examples which show how to use LLGL. Here is a brief overview:

Getting started tutorial where a single multi-colored triangle is rendered.

Simple tessellation example without any textures.

Simple texturing and sampler state example.

Shows how to use Query objects and conditional rendering for occlusion culling.

No screenshot available

Simple render target example with optional multi-sample texture (Texture2DMS/ sampler2DMS).

Multi-context tutorial shows the following rendering techniques: multiple render contexts (one window each), rendering simultaneously into multiple viewports, geometry shader.

Shows how to use buffer arrays, i.e. render with multiple vertex buffers simultaneously, and hardware instancing.

Small example with a compute shader and a storage buffer.

No screenshot available

Small example with a geometry shader and a stream-output buffer.

No screenshot available

Practical example of hardware instancing by rendering tens of thousands of different textured plants instances.

Practical example of a glow effect with post-processing and the usage of several shaders, render targets and graphics pipelines.

Experimental example of using multiple renderers at once (only supported on Win32 platform).

About

Low Level Graphics Library (LLGL) is a thin abstraction layer for modern graphics APIs such as OpenGL, Direct3D, and Vulkan

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 77.7%
  • C 15.3%
  • TeX 2.2%
  • CMake 2.1%
  • Objective-C++ 1.0%
  • GLSL 0.8%
  • Other 0.9%