libdragon
rdpq_attach.h
Go to the documentation of this file.
1
17#ifndef LIBDRAGON_RDPQ_ATTACH_H
18#define LIBDRAGON_RDPQ_ATTACH_H
19
20#include "rspq.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
53void rdpq_attach(const surface_t *surf_color, const surface_t *surf_z);
54
75void rdpq_attach_clear(const surface_t *surf_color, const surface_t *surf_z);
76
86inline void rdpq_clear(color_t color) {
87 extern void __rdpq_clear(const color_t *color);
88 __rdpq_clear(&color);
89}
90
100inline void rdpq_clear_z(uint16_t z) {
101 extern void __rdpq_clear_z(const uint16_t *z);
102 __rdpq_clear_z(&z);
103}
104
124inline void rdpq_detach(void)
125{
126 extern void rdpq_detach_cb(void (*cb)(void*), void *arg);
127 rdpq_detach_cb(NULL, NULL);
128}
129
135bool rdpq_is_attached(void);
136
152void rdpq_detach_show(void);
153
162inline void rdpq_detach_wait(void)
163{
164 rdpq_detach();
165 rspq_wait();
166}
167
183void rdpq_detach_cb(void (*cb)(void*), void *arg);
184
185#ifdef __cplusplus
186}
187#endif
188
189#endif /* LIBDRAGON_RDPQ_ATTACH_H */
Generic color structure.
Definition: graphics.h:52
void __rdpq_clear(const color_t *clr)
Like rdpq_clear, but with optional fill color configuration.
Definition: rdpq_attach.c:88
void __rdpq_clear_z(const uint16_t *z)
Like rdpq_clear_z, but with optional fill z value configuration.
Definition: rdpq_attach.c:101
void rdpq_clear_z(uint16_t z)
Reset the current Z buffer to a given value.
Definition: rdpq_attach.h:100
void rdpq_detach_cb(void(*cb)(void *), void *arg)
Detach the RDP from the current surface, and call a callback when the RDP has finished drawing to it.
Definition: rdpq_attach.c:123
void rdpq_detach_wait(void)
Detach the RDP from the current surface, waiting for RDP to finish drawing.
Definition: rdpq_attach.h:162
void rdpq_clear(color_t color)
Clear the current render target with the specified color.
Definition: rdpq_attach.h:86
void rdpq_attach(const surface_t *surf_color, const surface_t *surf_z)
Attach the RDP to a color surface (and optionally a Z buffer)
Definition: rdpq_attach.c:76
void rdpq_detach_show(void)
Detach the RDP from the current framebuffer, and show it on screen.
Definition: rdpq_attach.c:131
void rdpq_detach(void)
Detach the RDP from the current surface, and restore the previous one.
Definition: rdpq_attach.h:124
void rdpq_attach_clear(const surface_t *surf_color, const surface_t *surf_z)
Attach the RDP to a surface and clear it.
Definition: rdpq_attach.c:82
bool rdpq_is_attached(void)
Check if the RDP is currently attached to a surface.
Definition: rdpq_attach.c:22
void rspq_wait(void)
Wait until all commands in the queue have been executed by RSP.
Definition: rspq.c:1277
RSP Command queue.
A surface buffer for graphics.
Definition: surface.h:138