# LLGL **Repository Path**: studvc/LLGL ## Basic Information - **Project Name**: LLGL - **Description**: Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-19 - **Last Updated**: 2024-05-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Low Level Graphics Library (LLGL)

License Join the chat at https://gitter.im/LLGL-Project/community

## Documentation - **NOTE:** *This repository receives bug fixes only, but no major updates. Pull requests may still be accepted.* - **Version**: 0.03 Beta (see [ChangeLog](docu/ChangeLog)) - [Getting Started with LLGL](docu/GettingStarted/Getting%20Started%20with%20LLGL.pdf) (PDF) with Introduction, Hello Triangle Tutorial, and Extensibility Example with [GLFW](http://www.glfw.org/) - [LLGL Reference Manual](docu/refman.pdf) (PDF) - [LLGL Coding Conventions](docu/CodingConventions/Coding%20Conventions%20for%20LLGL.pdf) (PDF) - [Examples and Tutorials for C++](examples/Cpp) - [Examples for C#](examples/CSharp) ## Platform Support | Platform | CI | D3D12 | D3D11 | Vulkan | OpenGL | OpenGLES 3 | Metal | |----------|:--:|:-----:|:-----:|:------:|:------:|:----------:|:-----:| | Windows | [![Windows Build](https://ci.appveyor.com/api/projects/status/j09x8n07u3byfky0?svg=true)](https://ci.appveyor.com/project/LukasBanana/llgl) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | | GNU/Linux | [![GNU/Linux Build Status](http://badges.herokuapp.com/travis/LukasBanana/LLGL?env=BADGE_LINUX=&label=build)](https://travis-ci.org/LukasBanana/LLGL) | N/A | N/A | :heavy_check_mark: | :heavy_check_mark: | N/A | N/A | | macOS | [![macOS Build Status](http://badges.herokuapp.com/travis/LukasBanana/LLGL?env=BADGE_MACOS=&label=build)](https://travis-ci.org/LukasBanana/LLGL) | N/A | N/A | N/A | :heavy_check_mark: | N/A | :heavy_check_mark: | | iOS | [![iOS Build Status](http://badges.herokuapp.com/travis/LukasBanana/LLGL?env=BADGE_IOS=&label=build)](https://travis-ci.org/LukasBanana/LLGL) | N/A | N/A | N/A | N/A | :heavy_multiplication_x: | :heavy_check_mark: | | Android | | N/A | N/A | :heavy_multiplication_x: | N/A | :heavy_check_mark: | N/A | ## Build Notes Build scripts are provided for [**CMake**]((https://cmake.org/)). ### Windows [**Visual Studio 2015**](https://visualstudio.microsoft.com/) or later is required to build LLGL on Windows. ### macOS, iOS [**Xcode 9**](https://developer.apple.com/xcode/) or later is required to build LLGL on macOS and iOS. ### GNU/Linux The following development libraries are required to build LLGL on GNU/Linux: - **X11**: `libx11-dev` - **xf86vidmode**: `libxxf86vm-dev` - **Xrandr**: `libxrandr-dev` ### Android The [Android NDK](https://developer.android.com/ndk) with at least API level 21 is required. The build script to generate project files is currently only supported on **GNU/Linux** and requires [CMake 3.10](https://cmake.org/) or later and the [Code::Blocks](http://www.codeblocks.org/) IDE. *This platform support is currently in an experimental state.* ## Thin Abstraction Layer ```cpp // Unified Interface: CommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex); // OpenGL Implementation: void GLCommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex) { const GLintptr indices = (renderState_.indexBufferOffset + firstIndex * renderState_.indexBufferStride); glDrawElements( renderState_.drawMode, static_cast(numIndices), renderState_.indexBufferDataType, reinterpret_cast(indices) ); } // Direct3D 11 Implementation void D3D11CommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex) { context_->DrawIndexed(numIndices, firstIndex, 0); } // Direct3D 12 Implementation void D3D12CommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex) { commandList_->DrawIndexedInstanced(numIndices, 1, firstIndex, 0, 0); } // Vulkan Implementation void VKCommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex) { vkCmdDrawIndexed(commandBuffer_, numIndices, 1, firstIndex, 0, 0); } // Metal implementation void MTCommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex) { if (numPatchControlPoints_ > 0) { [renderEncoder_ drawIndexedPatches: numPatchControlPoints_ patchStart: static_cast(firstIndex) / numPatchControlPoints_ patchCount: static_cast(numIndices) / numPatchControlPoints_ patchIndexBuffer: nil patchIndexBufferOffset: 0 controlPointIndexBuffer: indexBuffer_ controlPointIndexBufferOffset: indexTypeSize_ * (static_cast(firstIndex)) instanceCount: 1 baseInstance: 0 ]; } else { [renderEncoder_ drawIndexedPrimitives: primitiveType_ indexCount: static_cast(numIndices) indexType: indexType_ indexBuffer: indexBuffer_ indexBufferOffset: indexTypeSize_ * static_cast(firstIndex) ]; } } ```