KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
pvr_misc.h File Reference

Miscellaneous utilities for the PVR API. More...

#include <stdint.h>
#include <sys/cdefs.h>

Go to the source code of this file.

Data Structures

struct  pvr_stats_t
 PVR statistics structure. More...
 

Macros

#define PVR_PACK_COLOR(a, r, g, b)
 Pack four floating point color values into a 32-bit integer form.
 

Functions

static uint32_t PVR_PACK_16BIT_UV (float u, float v)
 Pack two floating point coordinates into one 32-bit value, truncating them to 16-bits each.
 
void pvr_set_bg_color (float r, float g, float b)
 Set the background plane color.
 
void pvr_set_shadow_scale (bool enable, float scale_value)
 Set cheap shadow parameters.
 
void pvr_set_zclip (float zc)
 Set Z clipping depth.
 
void pvr_set_presort_mode (bool presort)
 Set the translucent polygon sort mode for the next frame.
 
int pvr_get_vbl_count (void)
 Retrieve the current VBlank count.
 
int pvr_get_stats (pvr_stats_t *stat)
 Get the current statistics from the PVR.
 

Detailed Description

Miscellaneous utilities for the PVR API.

Author
Megan Potter
Roger Cattermole
Paul Boese
Brian Paul
Lawrence Sebald
Benoit Miller
Ruslan Rostovtsev
Falco Girgis

Macro Definition Documentation

◆ PVR_PACK_COLOR

#define PVR_PACK_COLOR ( a,
r,
g,
b )
Value:
( \
( ((uint8_t)( (a) * 255 ) ) << 24 ) | \
( ((uint8_t)( (r) * 255 ) ) << 16 ) | \
( ((uint8_t)( (g) * 255 ) ) << 8 ) | \
( ((uint8_t)( (b) * 255 ) ) << 0 ) )

Pack four floating point color values into a 32-bit integer form.

All of the color values should be between 0 and 1.

Parameters
aAlpha value
rRed value
gGreen value
bBlue value
Returns
The packed color value

Function Documentation

◆ PVR_PACK_16BIT_UV()

static uint32_t PVR_PACK_16BIT_UV ( float u,
float v )
inlinestatic

Pack two floating point coordinates into one 32-bit value, truncating them to 16-bits each.

Parameters
uFirst coordinate to pack
vSecond coordinate to pack
Returns
The packed coordinates