mirror of
https://github.com/love2d/love.git
synced 2026-08-18 11:44:15 +02:00
Mesh:attachAttribute: add an optional start array index parameter.
Allows easier use of a single instance buffer with multiple draws when instanced attributes are used (#1878).
This commit is contained in:
@@ -57,6 +57,7 @@ public:
|
||||
StrongRef<Buffer> buffer;
|
||||
StrongRef<Mesh> mesh;
|
||||
int indexInBuffer;
|
||||
int startArrayIndex;
|
||||
AttributeStep step;
|
||||
bool enabled;
|
||||
};
|
||||
@@ -109,7 +110,7 @@ public:
|
||||
* to make sure this Mesh knows to flush the passed in Mesh's data to its
|
||||
* buffer when drawing.
|
||||
**/
|
||||
void attachAttribute(const std::string &name, Buffer *buffer, Mesh *mesh, const std::string &attachname, AttributeStep step = STEP_PER_VERTEX);
|
||||
void attachAttribute(const std::string &name, Buffer *buffer, Mesh *mesh, const std::string &attachname, int startindex = 0, AttributeStep step = STEP_PER_VERTEX);
|
||||
bool detachAttribute(const std::string &name);
|
||||
const std::vector<BufferAttribute> &getAttachedAttributes() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user