Added frame buffer support.
This commit is contained in:
34
src/display/framebuffer.h
Normal file
34
src/display/framebuffer.h
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "texture.h"
|
||||
|
||||
/**
|
||||
* Creates a new frame buffer that can be rendered to.
|
||||
*
|
||||
* @param width Width of the frame buffer (in pixels).
|
||||
* @param height Height of the frame buffer (in pixels).
|
||||
* @return A renderable frame buffer.
|
||||
*/
|
||||
framebuffer_t * frameBufferCreate(int32_t width, int32_t height);
|
||||
|
||||
/**
|
||||
* Use a given frame buffer as the current rendering context.
|
||||
*
|
||||
* @param frameBuffer Frame buffer to use, or NULL to not use any.
|
||||
* @param clear Whether or not to clear the frame buffer prior to rendering.
|
||||
*/
|
||||
void frameBufferUse(framebuffer_t *frameBuffer, bool clear);
|
||||
|
||||
/**
|
||||
* Dispose/cleanup a previously created frame buffer.
|
||||
*
|
||||
* @param frameBuffer Frame Buffer to clean.
|
||||
*/
|
||||
void frameBufferDispose(framebuffer_t *frameBuffer);
|
Reference in New Issue
Block a user