Commit Graph

30 Commits

Author SHA1 Message Date
Alex Szpakowski 63c5df6aa7 Begin unification of Canvases and Images. 2020-02-03 23:05:46 -04:00
Alex Szpakowski fc0d60a96d Move Canvas:getMSAA to Texture:getMSAA. 2020-02-03 19:26:11 -04:00
Alex Szpakowski b46b3ed552 Move some Canvas code to Texture, devirtualize Texture::draw. 2020-02-03 19:02:58 -04:00
Alex Szpakowski f9248d478c Refactor sampler state parameters for textures. 2020-02-02 22:26:28 -04:00
Alex Szpakowski 6c447ab4f6 Clean up some common Image and Canvas code. 2020-02-01 23:54:51 -04:00
Alex Szpakowski 5f9b5a21d0 Merge default into minor
--HG--
branch : minor
2020-01-03 22:45:36 -04:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski f3b52f66fe Update the internal naming convention for pixel formats.
--HG--
branch : minor
2019-12-23 23:38:04 -04:00
Alex Szpakowski f03b391245 Canvas:newImageData creates an ImageData with a pixel format that matches the canvas'. 2019-09-20 19:25:15 -03:00
Alex Szpakowski 0c2153e0ca Fix a potentially uninitialized value in love.graphics code. Minor cleanup. 2019-04-02 20:20:18 -03:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Alex Szpakowski 6808968893 Fix an issue when calculating the number of mipmaps for a volume/3D texture. 2018-01-06 01:55:09 -04:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Alex Szpakowski dd59803ad3 Error when invalid setting names are used in the tables passed to love.graphics.newCanvas and newImage. See issue #1312. 2017-12-28 23:16:51 -04:00
Alex Szpakowski e099e57052 Cleaned up some internal love.graphics code.
--HG--
branch : minor
2017-12-03 23:04:40 -04:00
Bart van Strien 9e4374935d Show (short) list of possible enum values when an invalid value is encountered (resolves #1318)
All enum errors have (hopefully) been changed to a luax_enumerror, which has a
fixed error message. If additionally a list of valid options is passed, it
lists that in the error message. For every enum error with few options I've
implemented this using a getConstants call.

This solution has been designed specifically to reduce the number of template
instantiations (as I've been told that was a concern). All new template code
happens in places where there already was an instantiation of the relevant
StringMap. Of course there is still std::vector<std::string>...

--HG--
branch : minor
2017-10-02 17:11:53 +02:00
Alex Szpakowski 844900db39 Rename all cases of 'pixel density' to 'DPI scale' in love's APIs.
--HG--
branch : minor
2017-09-24 16:09:05 -03:00
Alex Szpakowski 130ee7e1d9 Consolidated Image and Canvas dimension validation code.
--HG--
branch : minor
2017-07-11 20:38:47 -03:00
Alex Szpakowski 54a049e206 Restructured internal code for graphics capabilities. Added love.graphics.getTextureTypes which returns a table of Texture Type to boolean supported fields.
--HG--
branch : minor
2017-06-27 22:26:30 -03:00
Alex Szpakowski 45de7cebb6 Cleaned up some graphics code.
--HG--
branch : minor
2017-06-10 15:09:33 -03:00
Alex Szpakowski 10d73ea1d7 Moved some backend-agnostic code out of the OpenGL backend of love.graphics.
--HG--
branch : minor
2017-04-29 18:38:23 -03:00
Alex Szpakowski fd64999748 Allow calling love.graphics.drawLayer(arraycanvas, layer) when rendering to a different layer of the same Canvas.
--HG--
branch : minor
2017-04-29 13:35:07 -03:00
Alex Szpakowski 353852ca24 Fix the default mipmap filter of mipmapped Canvases (thanks Shell32).
--HG--
branch : minor
2017-04-28 21:36:50 -03:00
Alex Szpakowski 70b32c47ce Error if a non-2D/affine matrix is used with auto-batched draws, since they perform CPU-side matrix transforms on 2-component vectors.
--HG--
branch : minor
2017-04-23 00:12:57 -03:00
Alex Szpakowski 7161d600b7 Add mipmapping support to Canvases.
- Added an optional mipmap index argument to the non-table variant of love.graphics.setCanvas, and an optional ‘mipmap’ field to the table variant.
- Canvas:setMipmapFilter now works.
- Added Canvas:generateMipmaps.
- Added Canvas:getMipmapMode.
- Added a new ‘mipmaps’ enum field to the table passed into love.graphics.newCanvas. Accepted values are “none” (default), “manual”, and “auto”.

If a Canvas has the manual mipmap mode, you will either need to render to a mipmap level or call Canvas:generateMipmaps. If it has the auto mode, mipmaps will be automatically generated after rendering to that Canvas. Generating mipmaps is not free.

--HG--
branch : minor
2017-04-15 01:58:03 -03:00
Alex Szpakowski 9e94f5a375 love.graphics.drawLayer(canvas, …) now errors if the Canvas is currently active as a render target (matches behaviour of love.graphics.draw).
--HG--
branch : minor
2017-02-26 17:15:26 -04:00
Alex Szpakowski 66b299822a Array textures can be easily drawn without a shader (resolves issue #1111).
Added love.graphics.drawLayer(texture, layerindex, …). ‘texture’ must be an array texture.
Added SpriteBatch:add/setLayer.

Added Quad:get/setLayer. This applies to array textures that are drawn without specifying an explicit layer index in the draw call.

Added love.graphics.newQuad variants which have layer arguments.

--HG--
branch : minor
2017-02-26 17:11:22 -04:00
Alex Szpakowski 73fd45558b 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
2017-02-20 14:58:13 -04:00
Alex Szpakowski abb72cb813 Happy new year! 🥂
--HG--
branch : minor
2017-01-02 01:28:29 -04:00
Alex Szpakowski f12596dd19 More code restructuring.
Move all love.graphics functionality that doesn’t call OpenGL out of the OpenGL backend Graphics class.

--HG--
branch : minor
2016-12-30 18:36:54 -04:00