xerpi / libvita2d

Simple and Fast (using the GPU) 2D library for the PSVita
MIT License
137 stars 52 forks source link

Allow drawing of arbitrary colored and textured polygons #68

Closed thp closed 5 years ago

thp commented 5 years ago

This adds two new functions that give more control over rendering arbitrary polygons (and/or batching draw calls) while still leaving all the platform abstraction (setting up shader programs, etc...) to libvita2d.

void vita2d_draw_array(SceGxmPrimitiveType mode, const vita2d_color_vertex *vertices, size_t count);
void vita2d_draw_array_textured(const vita2d_texture *texture, SceGxmPrimitiveType mode, const vita2d_texture_vertex *vertices, size_t count, unsigned int color);

Example code (test case) is also included.

xerpi commented 5 years ago

Looks good, so I merged it, thanks!