Add backbuffer
This commit is contained in:
75
src/display/framebuffer/framebuffer.h
Normal file
75
src/display/framebuffer/framebuffer.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "display/display.h"
|
||||
#include "display/texture/texture.h"
|
||||
|
||||
typedef struct {
|
||||
#if DUSK_DISPLAY_SDL2
|
||||
// OpenGL Framebuffer Object ID
|
||||
GLuint id;
|
||||
#endif
|
||||
} framebuffer_t;
|
||||
|
||||
extern framebuffer_t FRAMEBUFFER_BACKBUFFER;
|
||||
extern const framebuffer_t *FRAMEBUFFER_BOUND;
|
||||
|
||||
void frameBufferInitBackbuffer();
|
||||
|
||||
/**
|
||||
* Gets the width of the framebuffer.
|
||||
*
|
||||
* @param framebuffer The framebuffer to get the width of.
|
||||
* @return The width of the framebuffer, or 0 if the framebuffer is NULL.
|
||||
*/
|
||||
int32_t frameBufferGetWidth(const framebuffer_t *framebuffer);
|
||||
|
||||
/**
|
||||
* Gets the height of the framebuffer.
|
||||
*
|
||||
* @param framebuffer The framebuffer to get the height of.
|
||||
* @return The height of the framebuffer, or 0 if the framebuffer is NULL.
|
||||
*/
|
||||
int32_t frameBufferGetHeight(const framebuffer_t *framebuffer);
|
||||
|
||||
/**
|
||||
* Binds the framebuffer for rendering, or the backbuffer if the framebuffer
|
||||
* provided is NULL.
|
||||
*
|
||||
* @param framebuffer The framebuffer to bind, or NULL to bind the backbuffer.
|
||||
*/
|
||||
void frameBufferBind(const framebuffer_t *framebuffer);
|
||||
|
||||
/**
|
||||
* Disposes of the framebuffer using EXT methods.
|
||||
*
|
||||
* @param framebuffer The framebuffer to dispose of.
|
||||
*/
|
||||
void frameBufferDispose(framebuffer_t *framebuffer);
|
||||
|
||||
// #if RENDER_USE_FRAMEBUFFER
|
||||
// typedef struct {
|
||||
// GLuint id;
|
||||
// texture_t texture;
|
||||
// } framebuffer_t;
|
||||
|
||||
// /**
|
||||
// * Initializes a framebuffer using EXT methods.
|
||||
// *
|
||||
// * @param framebuffer The framebuffer to initialize.
|
||||
// * @param width The width of the framebuffer.
|
||||
// * @param height The height of the framebuffer.
|
||||
// * @return An error code indicating success or failure.
|
||||
// */
|
||||
// void frameBufferInit(
|
||||
// framebuffer_t *framebuffer,
|
||||
// const uint32_t width,
|
||||
// const uint32_t height
|
||||
// );
|
||||
|
||||
// #endif
|
Reference in New Issue
Block a user