https://github.com/somecho/rlfbo
A utility class for using multisampled framebuffers in Raylib.
https://github.com/somecho/rlfbo
game-development glad graphics-programming opengl raylib raylib-cpp
Last synced: 3 months ago
JSON representation
A utility class for using multisampled framebuffers in Raylib.
- Host: GitHub
- URL: https://github.com/somecho/rlfbo
- Owner: somecho
- License: mit
- Created: 2024-08-10T12:32:23.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-11T16:15:31.000Z (11 months ago)
- Last Synced: 2025-01-20T23:25:57.894Z (5 months ago)
- Topics: game-development, glad, graphics-programming, opengl, raylib, raylib-cpp
- Language: C
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rlFbo
A utility class for using multisampled framebuffers in [Raylib](https://github.com/raysan5/raylib).
Raylib's default framebuffer objects `RenderTexture2D` are not multisampled by
default. To use multisampled framebuffers in Raylib, you can use OpenGL APIs.
This class simplifies this step.## Installation
### Manual Installation
You can directly copy `rlFbo/rlFbo.cpp` and `rlFbo/rlFbo.hpp` in to your project. Note that you will need `include/glad/glad.h` for raw OpenGL calls to work in Raylib, as the OpenGL context is initialized by `glad`. If you do not already have the header file, you can also copy it from this repo.
### CMake
Clone the repo and install the library.```sh
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/desired/install/path
cmake --build build --target install
```In your `CMakeLists.txt`:
```cmake
find_package(rlFbo)
target_link_libraries(YOUR_PROJECT PRIVATE rlFbo)
```Alternatively you can clone this repo to your project root and in your `CMakeLists.txt`:
```cmake
add_subdirectory(rlFbo)
target_link_libraries(YOUR_PROJECT PRIVATE rlFbo)
```## Example Usage
Below is an example of how you can use `rlFbo`. For more information, please
read the [header](rlFbo/rlFbo.hpp) file.```cpp
#include
#includevoid main(){
InitWindow(1280,720,"rlFbo Demo");
rlFbo myFbo(1280,720);
while(!WindowShouldClose()){
myFbo.begin();
ClearBackground(WHITE);
DrawCircle(640, 360, 300, RED);
myFbo.end();myFbo.draw();
BeginDrawing(); // needed for event polling
EndDrawing();
}
}
```## TODO
- [ ] [Match OpenGL internalformat to Raylib's PixelFormat.](https://github.com/somecho/rlFbo/issues/1)
---MIT License, Copyright © 2024 Somē Cho