Commit Graph

33 Commits

Author SHA1 Message Date
Bart van Strien a2ad1b462f Add love.graphics.pop("all"), which pops the entire stack (resolves #1248)
--HG--
branch : minor
2017-09-18 14:31:51 +02:00
Alex Szpakowski 8a77ea1007 Improve the error message when a type other than a table is given as the 3rd arg to newCanvas.
--HG--
branch : minor
2017-09-16 20:01:48 -03:00
Muh Muhten dda0200ffe Use proper type checking for coordinate arguments in love.graphics.points/line/polygon. Resolves issue #1325.
--HG--
branch : minor
2017-08-27 21:31:41 -03:00
Alex Szpakowski 9d0e984c3d Add love.filesystem.getInfo. Deprecate love.filesystem.exists/isDirectory/isFile/isSymlink/getLastModified/getSize. Resolves issue #641.
--HG--
branch : minor
2017-08-27 18:14:54 -03:00
Alex Szpakowski fee157b6b9 Functions that take a boolean argument now properly type-check for it.
--HG--
branch : minor
2017-08-14 22:56:20 -03:00
Alex Szpakowski 01c091882a Fix love.graphics.newImage(ImageData). Thanks Santos!
--HG--
branch : minor
2017-08-07 18:53:40 -03:00
Alex Szpakowski 2dd6408d00 Images/[Compressed]ImageData can be created using any Data, instead of just files or FileData.
--HG--
branch : minor
2017-08-05 23:55:20 -03:00
Alex Szpakowski 84d5d8b636 Move decoder-agnostic love.image code out of the magpie backend folder.
--HG--
branch : minor
2017-08-01 23:22:24 -03:00
Alex Szpakowski 217552b5ff love.graphics.newShader can accept File and FileData arguments (resolves issue #1308).
--HG--
branch : minor
2017-08-01 18:35:35 -03:00
Alex Szpakowski 17cf7bba83 Cleaned up love.graphics.newShader's wrapper code a bit.
--HG--
branch : minor
2017-07-29 23:09:45 -03:00
Alex Szpakowski 5ef6730497 Added a variant of love.graphics.captureScreenshot which takes a single filename parameter. Resolves issue #1293.
--HG--
branch : minor
2017-07-29 12:54:53 -03:00
Alex Szpakowski b3d4443f9d Added 'drawcallsbatched' field to the table returned by love.graphics.getStats.
It has the number of draw calls that were saved by auto-batching.

--HG--
branch : minor
2017-07-23 01:58:25 -03:00
Alex Szpakowski c37e9ed6bf Use vector2 arrays instead of raw float arrays for graphics primitives. Simplifies the code a bit.
--HG--
branch : minor
2017-07-23 01:49:27 -03:00
Alex Szpakowski 34ebe18f14 Use luaL_check/optinteger instead of luaL_check/optnumber when getting integer arguments to functions. Resolves issue #1251.
--HG--
branch : minor
2017-07-16 12:17:50 -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 9fe81ad922 Allow a temporary/internal depth buffer to be used when a Canvas is active, similar to how temporary stencil buffers are allowed.
Syntax is setCanvas{canvas [, depth=true, stencil=true]} or setCanvas{canvas, depthstencil=true}.

--HG--
branch : minor
2017-06-10 14:25:22 -03:00
Alex Szpakowski ac697ddb0f Clean up love’s internal Vector code a bit, and rename it to Vector2 so it’s more obvious what it is.
--HG--
branch : minor
2017-05-16 22:07:01 -03:00
Alex Szpakowski 621fb24ba1 Require stencil=true to be specified in setCanvas if stenciling is used while a Canvas is active and there is no custom stencil buffer.
--HG--
branch : minor
2017-04-29 21:29:37 -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 a0ef2ac28b Add Depth compare / shadow sampler support. Officially this is only supported in glsl3 shaders.
- Add Texture:setDepthSampleMode(comparemode). Only works on textures with depth pixel formats. A texture with the depth sample mode set will only work with a depth sampler.
- Add DepthImage, DepthArrayImage, and DepthCubeImage sampler keywords to glsl3.

--HG--
branch : minor
2017-04-12 20:26:06 -03:00
Alex Szpakowski 0001b4695e Add new variants of love.graphics.clear for controlling how the depth and stencil buffers are cleared.
- Add love.graphics.clear(r, g, b, a [, stencilvalue, depthvalue]).
- Add love.graphics.clear(color1, color2, …, [, stencilvalue, depthvalue]).
- Add love.graphics.clear(false, stencilvalue, depthvalue).

stencilvalue and depthvalue are either true, false, or a number. True is the default behaviour and clears that buffer to the default value (0 for stencil, 1 for depth), false prevents clearing.

The third variant listed above only clears the depth and/or stencil buffers and not the color buffer.

--HG--
branch : minor
2017-04-11 22:32:40 -03:00
Alex Szpakowski 43172bd3f6 Add optional ‘readable’ boolean field to the table passed into love.graphics.newCanvas. Added new variant of love.graphics.getCanvasFormats which takes a ‘readable’ boolean.
--HG--
branch : minor
2017-04-11 19:03:13 -03:00
Alex Szpakowski 018a3831cb Add a new “stencil8” pixel format for Canvases (resolves issue #1003).
Also fixed Canvas MSAA (resolves issue #1271).

stencil-formatted Canvases can’t be drawn, and can only be used as the value for a new ‘depthstencil’ field to the table-argument variant of love.graphics.setCanvas.

--HG--
branch : minor
2017-04-11 00:00:22 -03:00
Alex Szpakowski 08a377ff30 Rename love.graphics.flush to love.graphics.flushBatch.
Mesh/Spritebatch/Text:flush already exist and do something a bit different (flush vertices instead of render a pending batch).

--HG--
branch : minor
2017-04-08 18:53:48 -03:00
Bart van Strien b205b8a020 Remove references to old LOVE_ENABLE_module_implementation defines
As far as I know they are no longer used, as autotools was the primary (only)
user and it now switches entire modules.
I've also taken the opportunity to clean up the default list in
src/common/config.h.
Oh yeah, and this fixes linux builds not having graphics or audio backends.

--HG--
branch : minor
2017-03-30 19:09:15 +02:00
Alex Szpakowski 0fde3fde35 Add new variants of love.graphics.print/printf which accept a Font argument, rather than relying on global love.graphics state to determine the Font to use.
--HG--
branch : minor
2017-03-06 23:15:10 -04:00
Alex Szpakowski b44e6b2156 love.graphics.newVolumeImage can now automatically convert a 1xN or Nx1 sheet of square images into layers.
--HG--
branch : minor
2017-02-26 20:18:06 -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
Tanner Rogalsky bc6a2db22f Do not attempt to free pointer to scratch buffer
--HG--
branch : minor
2017-02-07 15:23:53 -05:00
Alex Szpakowski 8558d7894c Move all remaining love.graphics Lua wrapper code out of the opengl implementation folder.
--HG--
branch : minor
2017-01-29 01:19:37 -04:00