libdragon
Loading...
Searching...
No Matches
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
55void rdpq_attach(const surface_t *surf_color, const surface_t *surf_z);
56
77void rdpq_attach_clear(const surface_t *surf_color, const surface_t *surf_z);
78
88inline void rdpq_clear(color_t color) {
89 extern void __rdpq_clear(const color_t *color);
90 __rdpq_clear(&color);
91}
92
113inline void rdpq_clear_z(uint16_t z) {
114 extern void __rdpq_clear_z(const uint16_t *z);
115 __rdpq_clear_z(&z);
116}
117
137inline void rdpq_detach(void)
138{
139 extern void rdpq_detach_cb(void (*cb)(void*), void *arg);
140 rdpq_detach_cb(NULL, NULL);
141}
142
148bool rdpq_is_attached(void);
149
165void rdpq_detach_show(void);
166
175inline void rdpq_detach_wait(void)
176{
177 rdpq_detach();
178 rspq_wait();
179}
180
196void rdpq_detach_cb(void (*cb)(void*), void *arg);
197
198#ifdef __cplusplus
199}
200#endif
201
202#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:113
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:175
void rdpq_clear(color_t color)
Clear the current render target with the specified color.
Definition rdpq_attach.h:88
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:137
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