Skip to content

Commit

Permalink
Updated README.md documents and added showcase section.
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBanana committed Sep 2, 2023
1 parent 5bd80fa commit 1656d9c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 59 deletions.
87 changes: 28 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
<p align="center"><img src="docu/LLGL_Logo.png"/></p>


## Abstract

LLGL aims to be a thin abstraction layer for a wide variety of modern and legacy rendering APIs as well as a multitude of platforms targeting both desktop and mobile.
LLGL provides close coupling with the underlying APIs for a rich feature set while also simplifying architectural hurdles.
The library is written mostly in C++11 with the addition of a C99 wrapper.


## Documentation

- **Version**: 0.03 Beta (see [ChangeLog](docu/ChangeLog))
Expand All @@ -34,7 +41,7 @@ with Introduction, Hello Triangle Tutorial, and Extensibility Example with [GLFW

## Build Notes

Build scripts are provided for [**CMake**]((https://cmake.org/)).
Build scripts are provided for [**CMake**]((https://cmake.org/)). See [LLGL Build System](https://github.com/LukasBanana/LLGL/tree/master/docu#llgl-build-system) for more details.

### Windows

Expand Down Expand Up @@ -69,63 +76,25 @@ Alternatively, you can build and install LLGL using [vcpkg](https://github.com/M
./vcpkg install llgl
```

The llgl port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.

## Thin Abstraction Layer

```cpp
// Unified Interface:
CommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex);

// OpenGL Implementation:
void GLImmediateCommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex) {
glDrawElements(
GetDrawMode(), static_cast<GLsizei>(numIndices), GetIndexType(), GetIndicesOffset(firstIndex)
);
}

// Direct3D 11 Implementation
void D3D11CommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex) {
FlushConstantsCache();
context_->DrawIndexed(numIndices, firstIndex, 0);
}

// Direct3D 12 Implementation
void D3D12CommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex) {
FlushGraphicsStagingDescriptorTables();
commandList_->DrawIndexedInstanced(numIndices, 1, firstIndex, 0, 0);
}

// Vulkan Implementation
void VKCommandBuffer::DrawIndexed(std::uint32_t numIndices, std::uint32_t firstIndex) {
FlushDescriptorCache();
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<NSUInteger>(firstIndex) / numPatchControlPoints_
patchCount: static_cast<NSUInteger>(numIndices) / numPatchControlPoints_
patchIndexBuffer: nil
patchIndexBufferOffset: 0
controlPointIndexBuffer: indexBuffer_
controlPointIndexBufferOffset: indexTypeSize_ * (static_cast<NSUInteger>(firstIndex))
instanceCount: 1
baseInstance: 0
];
} else {
[renderEncoder_
drawIndexedPrimitives: primitiveType_
indexCount: static_cast<NSUInteger>(numIndices)
indexType: indexType_
indexBuffer: indexBuffer_
indexBufferOffset: indexTypeSize_ * static_cast<NSUInteger>(firstIndex)
];
}
}
```
The LLGL port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.


## Showcase

<p align="center">
<figure>
<img src="examples/Cpp/PostProcessing/Example.png" alt="Post processing example" id="fig.showcase.post_processing" title="Showcase-PostProcessing" style="width:300px;height:auto;">
<figcaption>Post processing example</figcaption>
</figure>

<figure>
<img src="examples/Cpp/Fonts/Example.iOS.png" alt="Fonts example (iOS)" id="fig.showcase.fonts-iOS" title="Showcase-Fonts-iOS" style="height:400px;width:auto;">
<figcaption>Fonts example (iOS simulator)</figcaption>
</figure>

<figure>
<img src="examples/Cpp/ClothPhysics/Example.iOS.png" alt="Cloth physics (iOS)" id="fig.showcase.cloth_physics-iOS" title="Showcase-ClothPhysics-iOS" style="height:400px;width:auto;">
<figcaption>Cloth physics example (iOS simulator)</figcaption>
</figure>
</p>

Binary file modified examples/Cpp/ClothPhysics/Example.iOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/Cpp/Fonts/Example.iOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1656d9c

Please sign in to comment.