Skip to content
/ rlFbo Public

A utility class for using multisampled framebuffers in Raylib.

License

Notifications You must be signed in to change notification settings

somecho/rlFbo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rlFbo

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.

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.

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)

Example Usage

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();
    }
}

TODO


MIT License, Copyright © 2024 Somē Cho

About

A utility class for using multisampled framebuffers in Raylib.

Topics

Resources

License

Stars

Watchers

Forks

Languages