mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Implement automatic batching for points, lines, shapes, and images/quads.
The above are batched together into a single draw call when called without other drawing calls in between, as long as the following criteria are met: - The texture is the same. - The primitive type is the same (points cannot be batched with non-points). - The love.graphics state is the same (aside from the current color - i.e. setColor - and the transform state). - The active shader’s uniform values are the same. You can examine the ‘drawcalls’ field of love.graphics.getStats() to help determine if your code is allowing for optimum batching. --HG-- branch : minor
This commit is contained in:
@@ -90,17 +90,7 @@ public:
|
||||
bool loadVolatile() override;
|
||||
void unloadVolatile() override;
|
||||
|
||||
/**
|
||||
* @copydoc Drawable::draw()
|
||||
**/
|
||||
void draw(const Matrix4 &m) override;
|
||||
|
||||
/**
|
||||
* @copydoc Texture::drawq()
|
||||
**/
|
||||
void drawq(Quad *quad, const Matrix4 &m) override;
|
||||
|
||||
const void *getHandle() const override;
|
||||
ptrdiff_t getHandle() const override;
|
||||
|
||||
const std::vector<StrongRef<love::image::ImageData>> &getImageData() const;
|
||||
const std::vector<StrongRef<love::image::CompressedImageData>> &getCompressedData() const;
|
||||
@@ -139,8 +129,6 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
void drawv(const Matrix4 &t, const Vertex *v);
|
||||
|
||||
void preload();
|
||||
|
||||
void generateMipmaps();
|
||||
|
||||
Reference in New Issue
Block a user