From 41cee3bd14ea17b23120dfd1f4eb125685a0a66a Mon Sep 17 00:00:00 2001 From: James Benton Date: Sun, 9 Oct 2016 20:57:50 +0100 Subject: [PATCH] gx2r: Add some gx2r draw functions. --- include/gx2/event.h | 8 ++++++++ include/gx2r/draw.h | 37 +++++++++++++++++++++++++++++++++++++ rpl/libgx2/exports.h | 4 ++++ 3 files changed, 49 insertions(+) create mode 100644 include/gx2r/draw.h diff --git a/include/gx2/event.h b/include/gx2/event.h index 0acc761b..13558571 100644 --- a/include/gx2/event.h +++ b/include/gx2/event.h @@ -18,10 +18,18 @@ typedef void (*GX2EventCallbackFunction)(GX2EventType, void *); struct GX2DisplayListOverrunData { + //! Pointer to overrun display list void *oldList; + + //! Size of overrun display list uint32_t oldSize; + + //! Pointer to new display list void *newList; + + //! Size of new display list uint32_t newSize; + UNKNOWN(8); }; CHECK_OFFSET(GX2DisplayListOverrunData, 0x00, oldList); diff --git a/include/gx2r/draw.h b/include/gx2r/draw.h new file mode 100644 index 00000000..60441a25 --- /dev/null +++ b/include/gx2r/draw.h @@ -0,0 +1,37 @@ +#pragma once +#include +#include +#include "resource.h" + +/** + * \defgroup gx2r_draw Draw + * \ingroup gx2r + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct GX2RBuffer GX2RBuffer; + +void +GX2RSetAttributeBuffer(GX2RBuffer *buffer, + uint32_t index, + uint32_t stride, + uint32_t offset); + +void +GX2RDrawIndexed(GX2PrimitiveMode mode, + GX2RBuffer *buffer, + GX2IndexType indexType, + uint32_t count, + uint32_t indexOffset, + uint32_t vertexOffset, + uint32_t numInstances); + +#ifdef __cplusplus +} +#endif + +/** @} */ diff --git a/rpl/libgx2/exports.h b/rpl/libgx2/exports.h index 21a6b822..ea175b6f 100644 --- a/rpl/libgx2/exports.h +++ b/rpl/libgx2/exports.h @@ -220,3 +220,7 @@ EXPORT(GX2REndDisplayList); EXPORT(GX2RCallDisplayList); EXPORT(GX2RDirectCallDisplayList); +// gx2r/draw.h +EXPORT(GX2RSetAttributeBuffer); +EXPORT(GX2RDrawIndexed); +