Select the types of activity you want to include in your feed.
Added GPU_PrimitiveEnum, GPU_PrimitiveBatch(), and GPU_PrimitiveBatchV() to support rendering points, lines, and other geometric primitives. GPU_TriangleBatch() is rebased to work on this. This resolves #107.
···479479static const Uint32 GPU_NONE = 0x0;
480480481481/*! \ingroup Rendering
482482- * Bit flags for geometry batching.
482482+ * Primitive types for rendering arbitrary geometry. The values are intentionally identical to the GL_* primitives.
483483+ * \see GPU_PrimitiveBatch()
484484+ * \see GPU_PrimitiveBatchV()
485485+ */
486486+typedef Uint32 GPU_PrimitiveEnum;
487487+static const GPU_PrimitiveEnum GPU_POINTS = 0x0;
488488+static const GPU_PrimitiveEnum GPU_LINES = 0x1;
489489+static const GPU_PrimitiveEnum GPU_LINE_LOOP = 0x2;
490490+static const GPU_PrimitiveEnum GPU_LINE_STRIP = 0x3;
491491+static const GPU_PrimitiveEnum GPU_TRIANGLES = 0x4;
492492+static const GPU_PrimitiveEnum GPU_TRIANGLE_STRIP = 0x5;
493493+static const GPU_PrimitiveEnum GPU_TRIANGLE_FAN = 0x6;
494494+495495+496496+/*! Bit flags for geometry batching.
483497 * \see GPU_TriangleBatch()
484498 * \see GPU_TriangleBatchX()
499499+ * \see GPU_PrimitiveBatch()
500500+ * \see GPU_PrimitiveBatchV()
485501 */
486502typedef Uint32 GPU_BatchFlagEnum;
487503static const GPU_BatchFlagEnum GPU_BATCH_XY = 0x1;
···14491465DECLSPEC void SDLCALL GPU_BlitRectX(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, GPU_Rect* dest_rect, float degrees, float pivot_x, float pivot_y, GPU_FlipEnum flip_direction);
145014661451146714521452-/*! Renders triangles from the given set of vertices. This lets you render arbitrary 2D geometry. It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
14681468+/*! Renders triangles from the given set of vertices. This lets you render arbitrary geometry. It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
14531469 * \param values A tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values. Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0. Pass NULL to render with only custom shader attributes.
14541470 * \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
14551471 * \param flags Bit flags to control the interpretation of the 'values' array parameters.
14561472 */
14571473DECLSPEC void SDLCALL GPU_TriangleBatch(GPU_Image* image, GPU_Target* target, unsigned short num_vertices, float* values, unsigned int num_indices, unsigned short* indices, GPU_BatchFlagEnum flags);
1458147414591459-/*! Renders triangles from the given set of vertices. This lets you render arbitrary 2D geometry. It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
14751475+/*! Renders triangles from the given set of vertices. This lets you render arbitrary geometry. It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
14601476 * \param values A tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values. Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0 (or 0 - 255 for 8-bit color components). Pass NULL to render with only custom shader attributes.
14611477 * \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
14621478 * \param flags Bit flags to control the interpretation of the 'values' array parameters.
14631479 */
14641480DECLSPEC void SDLCALL GPU_TriangleBatchX(GPU_Image* image, GPU_Target* target, unsigned short num_vertices, void* values, unsigned int num_indices, unsigned short* indices, GPU_BatchFlagEnum flags);
14811481+14821482+/*! Renders primitives from the given set of vertices. This lets you render arbitrary geometry. It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
14831483+ * \param primitive_type The kind of primitive to render.
14841484+ * \param values A tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values. Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0 (or 0 - 255 for 8-bit color components). Pass NULL to render with only custom shader attributes.
14851485+ * \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
14861486+ * \param flags Bit flags to control the interpretation of the 'values' array parameters.
14871487+ */
14881488+DECLSPEC void SDLCALL GPU_PrimitiveBatch(GPU_Image* image, GPU_Target* target, GPU_PrimitiveEnum primitive_type, unsigned short num_vertices, float* values, unsigned int num_indices, unsigned short* indices, GPU_BatchFlagEnum flags);
14891489+14901490+/*! Renders primitives from the given set of vertices. This lets you render arbitrary geometry. It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
14911491+ * \param primitive_type The kind of primitive to render.
14921492+ * \param values A tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values. Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0 (or 0 - 255 for 8-bit color components). Pass NULL to render with only custom shader attributes.
14931493+ * \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
14941494+ * \param flags Bit flags to control the interpretation of the 'values' array parameters.
14951495+ */
14961496+DECLSPEC void SDLCALL GPU_PrimitiveBatchV(GPU_Image* image, GPU_Target* target, GPU_PrimitiveEnum primitive_type, unsigned short num_vertices, void* values, unsigned int num_indices, unsigned short* indices, GPU_BatchFlagEnum flags);
1465149714661498/*! Send all buffered blitting data to the current context target. */
14671499DECLSPEC void SDLCALL GPU_FlushBlitBuffer(void);