srp
software rendering pipeline
Loading...
Searching...
No Matches
Framebuffer

Internals of the Framebuffer module. More...

Collaboration diagram for Framebuffer:

Files

file  framebuffer.c
 
file  framebuffer_p.h
 
SRPFramebuffersrpNewFramebuffer (size_t width, size_t height)
 
void srpFreeFramebuffer (SRPFramebuffer *this)
 
void framebufferNDCToScreenSpace (const SRPFramebuffer *this, const float *NDC, float *SS)
 
void srpFramebufferClear (const SRPFramebuffer *this)
 
void framebufferGetColorAndDepthPointers (const SRPFramebuffer *this, size_t x, size_t y, uint32_t **pColor, float **pDepth)
 

Detailed Description

Internals of the Framebuffer module.

See also
Framebuffer

Function Documentation

◆ framebufferGetColorAndDepthPointers()

void framebufferGetColorAndDepthPointers ( const SRPFramebuffer this,
size_t  x,
size_t  y,
uint32_t **  pColor,
float **  pDepth 
)

Get pointers inside color and depth buffers for pixel at (x, y)

Parameters
[in]thisPointer to the SRPFramebuffer
[in]x,yCoordinates of the needed pixel
[out]pColorPointer to the color buffer
[out]pDepthPointer to the depth buffer

◆ framebufferNDCToScreenSpace()

void framebufferNDCToScreenSpace ( const SRPFramebuffer this,
const float *  NDC,
float *  SS 
)

Convert Normalized Device Coordinates to screen-space coordiantes

Parameters
[in]thisThe pointer to SRPFramebuffer, as returned from srpNewFramebuffer
[in]NDCPointer to 3-element float array containing NDC position
[out]SSPointer to 3-element float array that will contain SS position after the call. The z-component is the same as z-component of NDC coordinates.

◆ srpFramebufferClear()

void srpFramebufferClear ( const SRPFramebuffer this)

Clear a framebuffer: fill the color with black and depth with -1

Parameters
[in]thisThe pointer to SRPFramebuffer, as returned from srpNewFramebuffer()

◆ srpFreeFramebuffer()

void srpFreeFramebuffer ( SRPFramebuffer this)

Free a framebuffer

Parameters
[in]thisThe pointer to SRPFramebuffer, as returned from srpNewFramebuffer()

◆ srpNewFramebuffer()

SRPFramebuffer * srpNewFramebuffer ( size_t  width,
size_t  height 
)

Create a framebuffer

Parameters
[in]widthWidth of a new framebuffer in pixels
[in]heightHeight of a new framebuffer in pixels
Returns
A pointer to the created framebuffer