-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
435 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#pragma once | ||
#include "renderbuffer.h" | ||
|
||
typedef struct C3D_RenderTarget_tag C3D_RenderTarget; | ||
|
||
struct C3D_RenderTarget_tag | ||
{ | ||
C3D_RenderTarget *next, *prev, *link, *frame[2]; | ||
C3D_RenderBuf renderBuf; | ||
u32 transferFlags; | ||
|
||
u8 clearBits; | ||
bool drawOk, transferOk; | ||
|
||
bool linked; | ||
gfxScreen_t screen; | ||
gfx3dSide_t side; | ||
}; | ||
|
||
// Flags for C3D_FrameBegin | ||
enum | ||
{ | ||
C3D_FRAME_SYNCDRAW = BIT(0), // Do not render the frame until the previous has finished rendering | ||
C3D_FRAME_NONBLOCK = BIT(1), // Return false instead of waiting for the GPU to finish rendering | ||
}; | ||
|
||
bool C3D_FrameBegin(u8 flags); | ||
bool C3D_FrameDrawOn(C3D_RenderTarget* target); | ||
void C3D_FrameEnd(u8 flags); | ||
|
||
// Flags for C3D_RenderTargetSetClear (only C3D_CLEAR_ALL implemented atm) | ||
enum | ||
{ | ||
C3D_CLEAR_COLOR = BIT(0), | ||
C3D_CLEAR_DEPTH = BIT(1), | ||
C3D_CLEAR_ALL = C3D_CLEAR_COLOR | C3D_CLEAR_DEPTH, | ||
}; | ||
|
||
C3D_RenderTarget* C3D_RenderTargetCreate(int width, int height, int colorFmt, int depthFmt); | ||
void C3D_RenderTargetDelete(C3D_RenderTarget* target); | ||
void C3D_RenderTargetSetClear(C3D_RenderTarget* target, u32 clearBits, u32 clearColor, u32 clearDepth); | ||
void C3D_RenderTargetSetOutput(C3D_RenderTarget* target, gfxScreen_t screen, gfx3dSide_t side, u32 transferFlags); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.