libdragon
Loading...
Searching...
No Matches
rdpq_attach.h
Go to the documentation of this file.
1
18#ifndef LIBDRAGON_RDPQ_ATTACH_H
19#define LIBDRAGON_RDPQ_ATTACH_H
20
21#include "rspq.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
56void rdpq_attach(const surface_t *surf_color, const surface_t *surf_z);
57
78void rdpq_attach_clear(const surface_t *surf_color, const surface_t *surf_z);
79
89inline void rdpq_clear(color_t color) {
90 extern void __rdpq_clear(const color_t *color);
91 __rdpq_clear(&color);
92}
93
114inline void rdpq_clear_z(uint16_t z) {
115 extern void __rdpq_clear_z(const uint16_t *z);
116 __rdpq_clear_z(&z);
117}
118
138inline void rdpq_detach(void)
139{
140 extern void rdpq_detach_cb(void (*cb)(void*), void *arg);
141 rdpq_detach_cb(NULL, NULL);
142}
143
149bool rdpq_is_attached(void);
150
166void rdpq_detach_show(void);
167
176inline void rdpq_detach_wait(void)
177{
178 rdpq_detach();
179 rspq_wait();
180}
181
197void rdpq_detach_cb(void (*cb)(void*), void *arg);
198
199#ifdef __cplusplus
200}
201#endif
202
203#endif /* LIBDRAGON_RDPQ_ATTACH_H */
Generic color structure.
Definition graphics.h:54
void __rdpq_clear(const color_t *clr)
Like rdpq_clear, but with optional fill color configuration.
Definition rdpq_attach.c:89
void __rdpq_clear_z(const uint16_t *z)
Like rdpq_clear_z, but with optional fill z value configuration.
Definition rdpq_attach.c:102
void rdpq_clear_z(uint16_t z)
Reset the current Z buffer to a given value.
Definition rdpq_attach.h:114
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:124
void rdpq_detach_wait(void)
Detach the RDP from the current surface, waiting for RDP to finish drawing.
Definition rdpq_attach.h:176
void rdpq_clear(color_t color)
Clear the current render target with the specified color.
Definition rdpq_attach.h:89
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:77
void rdpq_detach_show(void)
Detach the RDP from the current framebuffer, and show it on screen.
Definition rdpq_attach.c:132
void rdpq_detach(void)
Detach the RDP from the current surface, and restore the previous one.
Definition rdpq_attach.h:138
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:83
bool rdpq_is_attached(void)
Check if the RDP is currently attached to a surface.
Definition rdpq_attach.c:23
void rspq_wait(void)
Wait until all commands in the queue have been executed by RSP.
Definition rspq.c:1278
RSP Command queue.
A surface buffer for graphics.
Definition surface.h:140