Mario Kart 64
|
#include <libultraship.h>
#include "framebuffer_effects.h"
#include "mk64.h"
#include <assets/common_data.h>
#include "port/Engine.h"
#include "port/interpolation/matrix.h"
#include "math_util.h"
#include <stdio.h>
Functions | |
int | gfx_create_framebuffer (uint32_t width, uint32_t height, uint32_t native_width, uint32_t native_height, uint8_t resize) |
void | FB_CreateFramebuffers (void) |
void | FB_CopyToFramebuffer (Gfx **gfxP, s32 fb_src, s32 fb_dest, u8 oncePerFrame, u8 *hasCopied) |
void | FB_WriteFramebufferSliceToCPU (Gfx **gfxP, void *buffer, u8 byteSwap) |
void | FB_DrawFromFramebuffer (Gfx **gfxP, s32 fb, u8 alpha) |
void | FB_DrawFromFramebufferScaled (Gfx **gfxP, s32 fb, u8 alpha, float scaleX, float scaleY) |
Variables | |
s32 | gReusableFrameBuffer = -1 |
s32 | gN64ResFrameBuffer = -1 |
void FB_CopyToFramebuffer | ( | Gfx ** | gfxP, |
s32 | fb_src, | ||
s32 | fb_dest, | ||
u8 | oncePerFrame, | ||
u8 * | hasCopied ) |
Copies the current texture data from the source frame buffer to the destination frame buffer Setting oncePerFrame ensures that the copy will only happen once every game frame. This is important for effects that could be affected by increased frame interpolation (like motion blur). A pointer to a boolean is passed to the render for the render to set once the copy has been performed. This function uses opcodes from f3dex2 but may be called when s2dex is loaded, such as during shrink window. Make sure f3dex2 is loaded before this function is called.
void FB_CreateFramebuffers | ( | void | ) |
void FB_DrawFromFramebuffer | ( | Gfx ** | gfxP, |
s32 | fb, | ||
u8 | alpha ) |
Draws the texture data from the specified frame buffer as a full screen image
void FB_DrawFromFramebufferScaled | ( | Gfx ** | gfxP, |
s32 | fb, | ||
u8 | alpha, | ||
float | scaleX, | ||
float | scaleY ) |
Similar to FB_DrawFromFramebuffer, but scales the image relative to the center of the screen. This function uses opcodes from f3dex2 but may be called when s2dex is loaded, such as during shrink window. Make sure f3dex2 is loaded before this function is called.
void FB_WriteFramebufferSliceToCPU | ( | Gfx ** | gfxP, |
void * | buffer, | ||
u8 | byteSwap ) |
Copies a 4:3 slice of the current framebuffer scaled down to 320x240 to a CPU buffer address. The buffer output will be in RGBA16 format. Specify the byteswap flag to force the buffer data to be written as BigEndian, which is required if the buffer is being used as a texture in F3D.
int gfx_create_framebuffer | ( | uint32_t | width, |
uint32_t | height, | ||
uint32_t | native_width, | ||
uint32_t | native_height, | ||
uint8_t | resize ) |
s32 gN64ResFrameBuffer = -1 |
s32 gReusableFrameBuffer = -1 |