143#ifndef __LIBDRAGON_RDPQ_H
144#define __LIBDRAGON_RDPQ_H
160#define RDPQ_OVL_ID (0xC << 28)
163 RDPQ_CMD_NOOP = 0x00,
164 RDPQ_CMD_SET_LOOKUP_ADDRESS = 0x01,
165 RDPQ_CMD_FILL_RECTANGLE_EX = 0x02,
166 RDPQ_CMD_RESET_RENDER_MODE = 0x04,
167 RDPQ_CMD_SET_COMBINE_MODE_2PASS = 0x05,
168 RDPQ_CMD_PUSH_RENDER_MODE = 0x06,
169 RDPQ_CMD_POP_RENDER_MODE = 0x07,
171 RDPQ_CMD_TRI_ZBUF = 0x09,
172 RDPQ_CMD_TRI_TEX = 0x0A,
173 RDPQ_CMD_TRI_TEX_ZBUF = 0x0B,
174 RDPQ_CMD_TRI_SHADE = 0x0C,
175 RDPQ_CMD_TRI_SHADE_ZBUF = 0x0D,
176 RDPQ_CMD_TRI_SHADE_TEX = 0x0E,
177 RDPQ_CMD_TRI_SHADE_TEX_ZBUF = 0x0F,
179 RDPQ_CMD_TEXTURE_RECTANGLE_EX = 0x10,
180 RDPQ_CMD_SET_DEBUG_MODE = 0x11,
181 RDPQ_CMD_SET_SCISSOR_EX = 0x12,
182 RDPQ_CMD_SET_PRIM_COLOR_COMPONENT = 0x13,
183 RDPQ_CMD_MODIFY_OTHER_MODES = 0x14,
184 RDPQ_CMD_SET_FILL_COLOR_32 = 0x16,
185 RDPQ_CMD_SET_BLENDING_MODE = 0x18,
186 RDPQ_CMD_SET_FOG_MODE = 0x19,
187 RDPQ_CMD_SET_COMBINE_MODE_1PASS = 0x1B,
188 RDPQ_CMD_AUTOTMEM_SET_ADDR = 0x1C,
189 RDPQ_CMD_AUTOTMEM_SET_TILE = 0x1D,
190 RDPQ_CMD_TRIANGLE = 0x1E,
191 RDPQ_CMD_TRIANGLE_DATA = 0x1F,
193 RDPQ_CMD_TEXTURE_RECTANGLE = 0x24,
194 RDPQ_CMD_TEXTURE_RECTANGLE_FLIP = 0x25,
195 RDPQ_CMD_SYNC_LOAD = 0x26,
196 RDPQ_CMD_SYNC_PIPE = 0x27,
197 RDPQ_CMD_SYNC_TILE = 0x28,
198 RDPQ_CMD_SYNC_FULL = 0x29,
199 RDPQ_CMD_SET_KEY_GB = 0x2A,
200 RDPQ_CMD_SET_KEY_R = 0x2B,
201 RDPQ_CMD_SET_CONVERT = 0x2C,
202 RDPQ_CMD_SET_SCISSOR = 0x2D,
203 RDPQ_CMD_SET_PRIM_DEPTH = 0x2E,
204 RDPQ_CMD_SET_OTHER_MODES = 0x2F,
206 RDPQ_CMD_LOAD_TLUT = 0x30,
207 RDPQ_CMD_DEBUG = 0x31,
208 RDPQ_CMD_SET_TILE_SIZE = 0x32,
209 RDPQ_CMD_LOAD_BLOCK = 0x33,
210 RDPQ_CMD_LOAD_TILE = 0x34,
211 RDPQ_CMD_SET_TILE = 0x35,
212 RDPQ_CMD_FILL_RECTANGLE = 0x36,
213 RDPQ_CMD_SET_FILL_COLOR = 0x37,
214 RDPQ_CMD_SET_FOG_COLOR = 0x38,
215 RDPQ_CMD_SET_BLEND_COLOR = 0x39,
216 RDPQ_CMD_SET_PRIM_COLOR = 0x3A,
217 RDPQ_CMD_SET_ENV_COLOR = 0x3B,
218 RDPQ_CMD_SET_COMBINE_MODE_RAW = 0x3C,
219 RDPQ_CMD_SET_TEXTURE_IMAGE = 0x3D,
220 RDPQ_CMD_SET_Z_IMAGE = 0x3E,
221 RDPQ_CMD_SET_COLOR_IMAGE = 0x3F,
224#define RDPQ_CFG_AUTOSYNCPIPE (1 << 0)
225#define RDPQ_CFG_AUTOSYNCLOAD (1 << 1)
226#define RDPQ_CFG_AUTOSYNCTILE (1 << 2)
227#define RDPQ_CFG_AUTOSCISSOR (1 << 3)
228#define RDPQ_CFG_DEFAULT (0xFFFF)
232#define AUTOSYNC_TILE(n) (1 << (0+(n)))
233#define AUTOSYNC_TILES (0xFF << 0)
234#define AUTOSYNC_TMEM(n) (1 << (8+(n)))
235#define AUTOSYNC_TMEMS (0xFF << 8)
236#define AUTOSYNC_PIPE (1 << 16)
241#define _carg(value, mask, shift) (((uint32_t)((value) & (mask))) << (shift))
286#define RDPQ_TILE_INTERNAL TILE7
385inline void rdpq_set_yuv_parms(uint16_t k0, uint16_t k1, uint16_t k2, uint16_t k3, uint16_t k4, uint16_t k5)
389 _carg(k0, 0x1FF, 13) | _carg(k1, 0x1FF, 4) | (((uint32_t)(k2 & 0x1FF)) >> 5),
390 _carg(k2, 0x1F, 27) | _carg(k3, 0x1FF, 18) | _carg(k4, 0x1FF, 9) | _carg(k5, 0x1FF, 0),
423#define rdpq_set_scissor(x0, y0, x1, y1) ({ \
424 int32_t x0fx = (x0)*4; \
425 int32_t y0fx = (y0)*4; \
426 int32_t x1fx = (x1)*4; \
427 int32_t y1fx = (y1)*4; \
428 assertf(x0fx <= x1fx, "x1 must be greater or equal to x0"); \
429 assertf(y0fx <= y1fx, "y1 must be greater or equal to y0"); \
430 assertf(x0fx >= 0, "x0 must be positive"); \
431 assertf(y0fx >= 0, "y0 must be positive"); \
432 assertf(x1fx <= 0xFFF, "x1 must be less than 1024"); \
433 assertf(y1fx <= 0xFFF, "y1 must be less than 1024"); \
434 __rdpq_set_scissor( \
435 _carg(x0fx, 0xFFF, 12) | _carg(y0fx, 0xFFF, 0), \
436 _carg(x1fx, 0xFFF, 12) | _carg(y1fx, 0xFFF, 0)); \
468 assertf(prim_z <= 0x7FFF,
"prim_z must be in [0..0x7FFF]");
469 assertf((prim_dz & -prim_dz) == (prim_dz >= 0 ? prim_dz : -prim_dz),
470 "prim_dz must be a power of 2");
471 __rdpq_write8(RDPQ_CMD_SET_PRIM_DEPTH, 0, _carg(prim_z, 0xFFFF, 16) | _carg(prim_dz, 0xFFFF, 0));
519#define rdpq_load_tile(tile, s0, t0, s1, t1) ({ \
520 assertf((s0) >= 0 && (t0) >= 0 && (s1) >= 0 && (t1) >= 0, "texture coordinates must be positive"); \
521 assertf((s0) < 1024 && (t0) < 1024 && (s1) < 1024 && (t1) < 1024, "texture coordinates must be smaller than 1024"); \
522 rdpq_load_tile_fx((tile), (s0)*4, (t0)*4, (s1)*4, (t1)*4); \
552 _carg(s0, 0xFFF, 12) | _carg(t0, 0xFFF, 0),
553 _carg(tile, 0x7, 24) | _carg(s1-4, 0xFFF, 12) | _carg(t1-4, 0xFFF, 0),
554 AUTOSYNC_TMEM(0) | AUTOSYNC_TILE(tile),
555 AUTOSYNC_TILE(tile));
593 _carg(color_idx, 0xFF, 14),
594 _carg(tile, 0x7, 24) | _carg(color_idx+num_colors-1, 0xFF, 14),
596 AUTOSYNC_TILE(tile));
625#define rdpq_set_tile_size(tile, s0, t0, s1, t1) ({ \
626 rdpq_set_tile_size_fx((tile), (s0)*4, (t0)*4, (s1)*4, (t1)*4); \
646 assertf((s0) >= 0 && (t0) >= 0 && (s1) >= 0 && (t1) >= 0,
"texture coordinates must be positive");
647 assertf((s0) <= 1024*4 && (t0) <= 1024*4 && (s1) <= 1024*4 && (t1) <= 1024*4,
"texture coordinates must be smaller than 1024");
651 _carg(s0, 0xFFF, 12) | _carg(t0, 0xFFF, 0),
652 _carg(tile, 0x7, 24) | _carg(s1-4, 0xFFF, 12) | _carg(t1-4, 0xFFF, 0),
653 AUTOSYNC_TILE(tile));
664 _carg(s0, 0xFFF, 12) | _carg(t0, 0xFFF, 0),
665 _carg(tile, 0x7, 24) | _carg(num_texels-1, 0xFFF, 12) | _carg(dxt, 0xFFF, 0),
667 AUTOSYNC_TILE(tile));
719 assertf(num_texels <= 2048,
"invalid num_texels %d: must be smaller than 2048", num_texels);
720 assertf((tmem_pitch % 8) == 0,
"invalid tmem_pitch %d: must be multiple of 8", tmem_pitch);
722 uint32_t words = tmem_pitch / 8;
728#define RDPQ_AUTOTMEM (0x8000)
730#define RDPQ_AUTOTMEM_REUSE(offset) (0x4000 | ((offset)/8))
746 if (!parms) parms = &default_parms;
748 assertf(parms->s.shift >= -5 && parms->s.shift <= 10,
"invalid s shift %d: must be in [-5..10]", parms->s.shift);
749 assertf(parms->t.shift >= -5 && parms->t.shift <= 10,
"invalid t shift %d: must be in [-5..10]", parms->t.shift);
753 uint32_t cmd_id = RDPQ_CMD_SET_TILE;
755 cmd_id = RDPQ_CMD_AUTOTMEM_SET_TILE;
760 assertf((tmem_addr % 8) == 0,
"invalid tmem_addr %ld: must be multiple of 8", tmem_addr);
763 assertf((tmem_pitch % 8) == 0,
"invalid tmem_pitch %d: must be multiple of 8", tmem_pitch);
767 _carg(format, 0x1F, 19) | _carg(reuse, 0x1, 18) | _carg(tmem_pitch/8, 0x1FF, 9) | _carg(tmem_addr, 0x1FF, 0),
768 _carg(tile, 0x7, 24) | _carg(parms->
palette, 0xF, 20) |
769 _carg(parms->t.clamp | (parms->t.mask == 0), 0x1, 19) | _carg(parms->t.mirror, 0x1, 18) | _carg(parms->t.mask, 0xF, 14) | _carg(parms->t.shift, 0xF, 10) |
770 _carg(parms->s.clamp | (parms->s.mask == 0), 0x1, 9) | _carg(parms->s.mirror, 0x1, 8) | _carg(parms->s.mask, 0xF, 4) | _carg(parms->s.shift, 0xF, 0),
771 AUTOSYNC_TILE(tile));
862 uint32_t c1 = (((int)color1.
r >> 3) << 11) | (((
int)color1.
g >> 3) << 6) | (((int)color1.
b >> 3) << 1) | (color1.
a >> 7);
863 uint32_t c2 = (((int)color2.
r >> 3) << 11) | (((
int)color2.
g >> 3) << 6) | (((int)color2.
b >> 3) << 1) | (color2.
a >> 7);
978 int8_t conv = (1.0 - value) * 31;
1042 extern void __rdpq_write8(uint32_t cmd_id, uint32_t arg0, uint32_t arg1);
1164 "Image format is not supported as color image: %s\nIt must be FMT_RGBA32, FMT_RGBA16, FMT_I8 or FMT_CI8",
tex_format_name(format));
1165 assertf(index <= 15,
"Lookup address index out of range [0,15]: %d", index);
1169 _carg(format, 0x1F, 19) | _carg(
TEX_FORMAT_BYTES2PIX(format, stride)-1, 0x3FF, 0) | _carg(height-1, 0x1FF, 10),
1170 _carg(index, 0xF, 28) | (offset & 0xFFFFFF) | _carg((height-1)>>9, 0x1, 31),
1171 _carg(0, 0xFFF, 12) | _carg(0, 0xFFF, 0),
1172 _carg(width*4, 0xFFF, 12) | _carg(height*4, 0xFFF, 0));
1196 assertf(index <= 15,
"Lookup address index out of range [0,15]: %d", index);
1200 _carg(index, 0xF, 28) | (offset & 0xFFFFFF),
1228 assertf(width <= 1024,
"Texture width out of range [1,1024]: %d", width);
1229 assertf(height <= 1024,
"Texture height out of range [1,1024]: %d", height);
1230 assertf(index <= 15,
"Lookup address index out of range [0,15]: %d", index);
1235 _carg(format, 0x1F, 19) | _carg(width-1, 0x3FF, 0) | _carg(height-1, 0x1FF, 10),
1236 _carg(index, 0xF, 28) | (offset & 0xFFFFFF) | _carg((height-1)>>9, 0x1, 31),
1298 assertf(index > 0 && index <= 15,
"Lookup address index out of range [1,15]: %d", index);
1394 (mode >> 32) & 0x00FFFFFF,
1458 (comb >> 32) & 0x00FFFFFF,
1541#define rdpq_write(num_rdp_commands, ovl_id, cmd_id, ...) ({ \
1542 int __num_rdp_commands = (num_rdp_commands); \
1543 if (!__builtin_constant_p(__num_rdp_commands) || __num_rdp_commands != 0) { \
1544 extern rspq_block_t *rspq_block; \
1545 if (__builtin_expect(rspq_block != NULL, 0)) { \
1546 extern void __rdpq_block_reserve(int); \
1547 __rdpq_block_reserve(__num_rdp_commands); \
1550 rspq_write(ovl_id, cmd_id, ##__VA_ARGS__); \
uint8_t a
Alpha component.
Definition graphics.h:60
uint8_t g
Green component.
Definition graphics.h:56
uint8_t b
Blue component.
Definition graphics.h:58
uint8_t r
Red component.
Definition graphics.h:54
uint32_t color_to_packed32(color_t c)
Convert a color_t to the 32-bit packed format used by a FMT_RGBA32 surface (RGBA 8888)
Definition graphics.h:84
Generic color structure.
Definition graphics.h:52
#define PhysicalAddr(_addr)
Return the physical memory address for a given address.
Definition n64sys.h:121
void __rdpq_set_scissor(uint32_t w0, uint32_t w1)
Out-of-line implementation of rdpq_set_scissor.
Definition rdpq.c:971
void __rdpq_set_fill_color(uint32_t w1)
Out-of-line implementation of rdpq_set_fill_color.
Definition rdpq.c:982
void __rdpq_change_other_modes(uint32_t w0, uint32_t w1, uint32_t w2)
Out-of-line implementation of rdpq_change_other_modes_raw.
Definition rdpq.c:1070
void __rdpq_write8_syncchangeuse(uint32_t cmd_id, uint32_t arg0, uint32_t arg1, uint32_t autosync_c, uint32_t autosync_u)
Write a standard 8-byte RDP command, which changes some autosync resources and uses others.
Definition rdpq.c:927
void __rdpq_set_other_modes(uint32_t w0, uint32_t w1)
Out-of-line implementation of rdpq_set_other_modes_raw.
Definition rdpq.c:1055
void __rdpq_set_color_image(uint32_t w0, uint32_t w1, uint32_t sw0, uint32_t sw1)
Out-of-line implementation of rdpq_set_color_image.
Definition rdpq.c:990
void __rdpq_fixup_write8_syncchange(uint32_t cmd_id, uint32_t w0, uint32_t w1, uint32_t autosync)
Write a 8-byte RDP command fixup.
Definition rdpq.c:951
void __rdpq_write8_syncchange(uint32_t cmd_id, uint32_t arg0, uint32_t arg1, uint32_t autosync)
Write a standard 8-byte RDP command, which changes some autosync resources
Definition rdpq.c:911
void __rdpq_write8(uint32_t cmd_id, uint32_t arg0, uint32_t arg1)
Write a standard 8-byte RDP command.
Definition rdpq.c:904
void rdpq_load_block_fx(rdpq_tile_t tile, uint16_t s0, uint16_t t0, uint16_t num_texels, uint16_t dxt)
Low level function to load a texture image into TMEM in a single memory transfer.
Definition rdpq.h:660
void rdpq_set_color_image_raw(uint8_t index, uint32_t offset, tex_format_t format, uint32_t width, uint32_t height, uint32_t stride)
Low-level version of rdpq_set_color_image, with address lookup capability.
Definition rdpq.h:1160
void rdpq_set_texture_image(const surface_t *surface)
Configure the texture to use (RDP command: SET_TEX_IMAGE)
Definition rdpq.c:1040
void rdpq_set_env_color(color_t color)
Set the RDP ENV combiner register (RDP command: SET_ENV_COLOR)
Definition rdpq.h:1067
void rdpq_close(void)
Shutdown the RDPQ library.
Definition rdpq.c:487
void rdpq_set_prim_lod_frac(uint8_t value)
Set the RDP PRIM LOD FRAC combiner register (RDP command: SET_PRIM_COLOR (partial))
Definition rdpq.h:1002
void rdpq_set_tile(rdpq_tile_t tile, tex_format_t format, int32_t tmem_addr, uint16_t tmem_pitch, const rdpq_tileparms_t *parms)
Enqueue a RDP SET_TILE command (full version)
Definition rdpq.h:739
void rdpq_set_combiner_raw(uint64_t comb)
Low-level function to change the RDP combiner.
Definition rdpq.h:1455
void rdpq_set_yuv_parms(uint16_t k0, uint16_t k1, uint16_t k2, uint16_t k3, uint16_t k4, uint16_t k5)
Low level functions to set the matrix coefficients for texture format conversion.
Definition rdpq.h:385
void rdpq_exec(void *buffer, int size)
Send to the RDP a buffer of RDP commands from RDRAM.
Definition rdpq.c:527
void rdpq_init(void)
Initialize the RDPQ library.
Definition rdpq.c:445
void rdpq_change_other_modes_raw(uint64_t mask, uint64_t val)
Low-level function to partly change the rendering mode register.
Definition rdpq.h:1416
void rdpq_set_fill_color(color_t color)
Enqueue a SET_FILL_COLOR RDP command.
Definition rdpq.h:837
void rdpq_sync_load(void)
Schedule a RDP SYNC_LOAD command.
Definition rdpq.c:1125
void rdpq_set_prim_register_raw(color_t color, uint8_t minlod, uint8_t primlod)
Set the RDP PRIM combiner register (raw version) (RDP command: SET_PRIM_COLOR)
Definition rdpq.h:1040
uint8_t palette
Optional palette associated to the texture. For textures in FMT_CI4 format, specify the palette index...
Definition rdpq.h:272
void rdpq_set_fog_color(color_t color)
Set the RDP FOG blender register.
Definition rdpq.h:889
void rdpq_set_z_image(const surface_t *surface)
Configure the Z-buffer to use (RDP command: SET_Z_IMAGE)
Definition rdpq.c:1027
rdpq_tile_t
Tile descriptors.
Definition rdpq.h:249
@ TILE5
Tile #5 (for code readability)
Definition rdpq.h:255
@ TILE3
Tile #3 (for code readability)
Definition rdpq.h:253
@ TILE4
Tile #4 (for code readability)
Definition rdpq.h:254
@ TILE7
Tile #7 (for code readability)
Definition rdpq.h:257
@ TILE0
Tile #0 (for code readability)
Definition rdpq.h:250
@ TILE1
Tile #1 (for code readability)
Definition rdpq.h:251
@ TILE6
Tile #6 (for code readability)
Definition rdpq.h:256
@ TILE2
Tile #2 (for code readability)
Definition rdpq.h:252
void rdpq_set_color_image(const surface_t *surface)
Configure the framebuffer to render to (RDP command: SET_COLOR_IMAGE)
Definition rdpq.c:1001
void rdpq_set_detail_factor(float value)
Set the detail/sharpen blending factor (RDP command: SET_PRIM_COLOR (partial))
Definition rdpq.h:975
void rdpq_load_block(rdpq_tile_t tile, uint16_t s0, uint16_t t0, uint16_t num_texels, uint16_t tmem_pitch)
Load a texture image into TMEM with a single contiguous memory transfer (RDP command: LOAD_BLOCK)
Definition rdpq.h:717
void rdpq_set_tile_size_fx(rdpq_tile_t tile, uint16_t s0, uint16_t t0, uint16_t s1, uint16_t t1)
Configure the extents of a tile descriptor – fixed point version (RDP command: SET_TILE_SIZE)
Definition rdpq.h:644
void rdpq_sync_full(void(*callback)(void *), void *arg)
Schedule a RDP SYNC_FULL command and register a callback when it is done.
Definition rdpq.c:1100
void rdpq_sync_tile(void)
Schedule a RDP SYNC_TILE command.
Definition rdpq.c:1119
void rdpq_set_texture_image_raw(uint8_t index, uint32_t offset, tex_format_t format, uint16_t width, uint16_t height)
Low-level version of rdpq_set_texture_image, with address lookup capability.
Definition rdpq.h:1226
void rdpq_set_fill_color_stripes(color_t color1, color_t color2)
Enqueue a SET_FILL_COLOR RDP command to draw a striped pattern.
Definition rdpq.h:860
void rdpq_set_prim_depth_raw(uint16_t prim_z, int16_t prim_dz)
Set a fixed Z value to be used instead of a per-pixel value (RDP command; SET_PRIM_DEPTH)
Definition rdpq.h:464
void rdpq_set_lookup_address(uint8_t index, void *rdram_addr)
Store an address into the rdpq lookup table.
Definition rdpq.h:1296
void rdpq_load_tlut_raw(rdpq_tile_t tile, int color_idx, int num_colors)
Load a palette of colors into TMEM (RDP command: LOAD_TLUT)
Definition rdpq.h:589
void rdpq_sync_pipe(void)
Schedule a RDP SYNC_PIPE command.
Definition rdpq.c:1113
uint64_t rdpq_get_other_modes_raw(void)
Read the current render mode register.
Definition rdpq.c:1085
void rdpq_set_prim_color(color_t color)
Set the RDP PRIM combiner register (color only) (RDP command: SET_PRIM_COLOR)
Definition rdpq.h:951
void rdpq_load_tile_fx(rdpq_tile_t tile, uint16_t s0, uint16_t t0, uint16_t s1, uint16_t t1)
Load a portion of a texture into TMEM – fixed point version (RDP command: LOAD_TILE)
Definition rdpq.h:548
#define RDPQ_AUTOTMEM
Special TMEM address to pass to rdpq_set_tile to use automatic TMEM allocation.
Definition rdpq.h:728
void rdpq_set_blend_color(color_t color)
Set the RDP BLEND blender register.
Definition rdpq.h:917
void rdpq_set_z_image_raw(uint8_t index, uint32_t offset)
Low-level version of rdpq_set_z_image, with address lookup capability.
Definition rdpq.h:1194
void rdpq_fence(void)
Add a fence to synchronize RSP with RDP commands.
Definition rdpq.c:517
uint32_t rdpq_config_disable(uint32_t cfg_disable_bits)
Disable a specific set of configuration flags.
Definition rdpq.c:512
uint32_t rdpq_config_enable(uint32_t cfg_enable_bits)
Enable a specific set of configuration flags.
Definition rdpq.c:507
uint32_t rdpq_config_set(uint32_t cfg)
Set the configuration of the RDPQ module.
Definition rdpq.c:500
void rdpq_set_tile_autotmem(int16_t tmem_bytes)
Configure the auto-TMEM feature of rdpq_set_tile.
Definition rdpq.c:1091
void rdpq_set_other_modes_raw(uint64_t mode)
Low-level function to set the rendering mode register.
Definition rdpq.h:1390
#define RDPQ_AUTOTMEM_REUSE(offset)
Special TMEM address to pass to rdpq_set_tile to configure a tile with the same address of previous t...
Definition rdpq.h:730
Tile parameters for rdpq_set_tile.
Definition rdpq.h:271
const char * tex_format_name(tex_format_t fmt)
Return the name of the texture format as a string (for debugging purposes)
Definition surface.c:14
Surface buffers used to draw images.
tex_format_t
Pixel format enum.
Definition surface.h:103
@ FMT_RGBA32
Format RGBA 8888 (32-bit)
Definition surface.h:107
@ FMT_CI8
Format CI8: color index 8-bit (paletted, 1 index per byte)
Definition surface.h:110
@ FMT_I8
Format I8: 8-bit intensity (8-bit per pixel)
Definition surface.h:115
@ FMT_RGBA16
Format RGBA 5551 (16-bit)
Definition surface.h:106
#define TEX_FORMAT_BYTES2PIX(fmt, bytes)
Convert the specified number of bytes to pixels.
Definition surface.h:89
A surface buffer for graphics.
Definition surface.h:138