mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Backported commits 145524a and 7785b4b from minor into default (Added SpriteBatch:flush, deprecated SpriteBatch:bind/unbind, SpriteBatch:flush is called implicitly when the spritebatch is drawn.)
This commit is contained in:
@@ -28,6 +28,9 @@
|
||||
// OpenGL
|
||||
#include "OpenGL.h"
|
||||
|
||||
// C
|
||||
#include <stddef.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace graphics
|
||||
@@ -152,8 +155,12 @@ public:
|
||||
* when used to draw elements.
|
||||
*
|
||||
* The VertexBuffer must be bound to use this function.
|
||||
*
|
||||
* @param usedOffset The offset into the mapped buffer indicating the
|
||||
* sub-range of data modified. Optional.
|
||||
* @param usedSize The size of the sub-range of modified data. Optional.
|
||||
*/
|
||||
virtual void unmap() = 0;
|
||||
virtual void unmap(size_t usedOffset = 0, size_t usedSize = -1) = 0;
|
||||
|
||||
/**
|
||||
* Bind the VertexBuffer to its specified target.
|
||||
@@ -294,7 +301,7 @@ public:
|
||||
|
||||
// Implements VertexBuffer.
|
||||
virtual void *map();
|
||||
virtual void unmap();
|
||||
virtual void unmap(size_t usedOffset = 0, size_t usedSize = -1);
|
||||
virtual void bind();
|
||||
virtual void unbind();
|
||||
virtual void fill(size_t offset, size_t size, const void *data);
|
||||
@@ -328,7 +335,7 @@ public:
|
||||
|
||||
// Implements VertexBuffer.
|
||||
virtual void *map();
|
||||
virtual void unmap();
|
||||
virtual void unmap(size_t usedOffset = 0, size_t usedSize = -1);
|
||||
virtual void bind();
|
||||
virtual void unbind();
|
||||
virtual void fill(size_t offset, size_t size, const void *data);
|
||||
@@ -355,12 +362,15 @@ private:
|
||||
*/
|
||||
void unload(bool save);
|
||||
|
||||
void unmapStatic(size_t offset, size_t size);
|
||||
void unmapStream();
|
||||
|
||||
// The VBO identifier. Assigned by OpenGL.
|
||||
GLuint vbo;
|
||||
|
||||
// A pointer to mapped memory. Will be inialized on the first
|
||||
// call to map().
|
||||
void *memory_map;
|
||||
char *memory_map;
|
||||
|
||||
// Set if the buffer was modified while operating on gpu memory
|
||||
// and needs to be synchronized.
|
||||
|
||||
Reference in New Issue
Block a user