A utility class for using multisampled framebuffers in 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.
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.
Clone the repo and install the library.
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/desired/install/path
cmake --build build --target install
In your CMakeLists.txt
:
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
:
add_subdirectory(rlFbo)
target_link_libraries(YOUR_PROJECT PRIVATE rlFbo)
Below is an example of how you can use rlFbo
. For more information, please
read the header file.
#include <raylib.h>
#include <rlFbo/rlFbo.hpp>
void 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();
}
}
MIT License, Copyright © 2024 Somē Cho