mirror of
https://github.com/love2d/love.git
synced 2026-08-18 11:44:15 +02:00
Implement Array, Cubemap, and Volume texture types (issue #1111).
- Add love.graphics.newArrayImage, newCubeImage, and newVolumeImage.
- Add love.graphics.newCanvas(w, h, layers) and newCanvas(w, h, layers, settings). Add ‘type’ field to the settings table of newCanvas.
- Add new love.graphics.setCanvas variants: setCanvas(canvas, slice), and setCanvas(canvastable) where canvastable is in the format: {{canvas1, layer=2}, {canvas2, face=5}}
- Add Texture:getTextureType, getDepth, getLayerCount, getMipmapCount, and getFormat.
- Remove Image:getData and Image:refresh.
- Add Image:replacePixels(imagedata [, slice] [, mipmap]).
- Update Canvas:newImageData to accept a slice argument.
- Add love.image.newCubeFaces(imagedata).
--HG--
branch : minor
This commit is contained in:
@@ -99,6 +99,9 @@ void Mesh::drawInstanced(love::graphics::Graphics *gfx, const love::Matrix4 &m,
|
||||
if (instancecount > 1 && !gl.isInstancingSupported())
|
||||
throw love::Exception("Instancing is not supported on this system.");
|
||||
|
||||
if (Shader::current && texture.get())
|
||||
Shader::current->checkMainTextureType(texture->getTextureType());
|
||||
|
||||
gfx->flushStreamDraws();
|
||||
|
||||
OpenGL::TempDebugGroup debuggroup("Mesh draw");
|
||||
@@ -131,7 +134,10 @@ void Mesh::drawInstanced(love::graphics::Graphics *gfx, const love::Matrix4 &m,
|
||||
|
||||
gl.useVertexAttribArrays(enabledattribs, instancedattribs);
|
||||
|
||||
gl.bindTextureToUnit(texture, 0, false);
|
||||
if (texture.get())
|
||||
gl.bindTextureToUnit(texture, 0, false);
|
||||
else
|
||||
gl.bindTextureToUnit(TEXTURE_2D, gl.getDefaultTexture(TEXTURE_2D), 0, false);
|
||||
|
||||
Graphics::TempTransform transform(gfx, m);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user