libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
gfxbridge.h File Reference
#include "stdint.h"
#include "fast/ucodehandlers.h"
#include "ship/Api.h"
#include <memory>
Include dependency graph for gfxbridge.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Fast
 

Functions

void GfxSetFast3dWindow (std::shared_ptr< Fast::Fast3dWindow > window)
 
std::shared_ptr< Fast::Fast3dWindowGfxGetFast3dWindow ()
 
API_EXPORT void GfxSetNativeDimensions (uint32_t width, uint32_t height)
 Sets the native (un-scaled) rendering resolution used by the graphics backend.
 
API_EXPORT void GfxGetPixelDepthPrepare (float x, float y)
 Prepares the graphics backend to sample the pixel depth at screen coordinate (x, y).
 
API_EXPORT uint16_t GfxGetPixelDepth (float x, float y)
 Returns the pixel depth at screen coordinate (x, y).
 

Function Documentation

◆ GfxGetFast3dWindow()

std::shared_ptr< Fast::Fast3dWindow > GfxGetFast3dWindow ( )

◆ GfxGetPixelDepth()

API_EXPORT uint16_t GfxGetPixelDepth ( float  x,
float  y 
)

Returns the pixel depth at screen coordinate (x, y).

Must be called after GfxGetPixelDepthPrepare() for the same coordinates.

Parameters
xScreen X coordinate in pixels.
yScreen Y coordinate in pixels.
Returns
Depth value in the range [0, 65535] (16-bit fixed-point).

◆ GfxGetPixelDepthPrepare()

API_EXPORT void GfxGetPixelDepthPrepare ( float  x,
float  y 
)

Prepares the graphics backend to sample the pixel depth at screen coordinate (x, y).

Call this before GfxGetPixelDepth() to ensure the depth value is ready.

Parameters
xScreen X coordinate in pixels.
yScreen Y coordinate in pixels.

◆ GfxSetFast3dWindow()

void GfxSetFast3dWindow ( std::shared_ptr< Fast::Fast3dWindow window)

◆ GfxSetNativeDimensions()

API_EXPORT void GfxSetNativeDimensions ( uint32_t  width,
uint32_t  height 
)

Sets the native (un-scaled) rendering resolution used by the graphics backend.

Parameters
widthNative framebuffer width in pixels.
heightNative framebuffer height in pixels.