Commit Graph

1323 Commits

Author SHA1 Message Date
Alex Szpakowski 39201af79f Improve the error message when an invalid layer or face index is given in love.graphics.setMode. 2018-01-14 19:15:24 -04:00
Alex Szpakowski ac52666c6f Rename ParticleSystem:setAreaSpread to setEmissionArea, and move the functionality from setAreaSpreadAngle/setAreSpreadIsRelativeDirection into setEmissionArea. Resolves issue #1311. 2018-01-13 21:11:07 -04:00
Alex Szpakowski 2459752c06 Add support for partial Image updates via Image:replacePixels(imagedata [, sliceindex, mipmap, x, y]) with a smaller-sized ImageData.
Also updated the argument order of Canvas:newImageData to match: (sliceindex, mipmap, x, y, w, h).
2018-01-10 22:52:28 -04:00
Alex Szpakowski 22f72c7da6 Fix a crash in Image:replacePixels when a different ImageData is given than the one that created the Image. 2018-01-10 21:31:00 -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
Alex Szpakowski 3857d09132 Don't use persistently mapped buffers on Intel Ivy Bridge GPUs on Windows. glClientWaitSync can hang with those drivers, apparently. 2018-01-06 00:42:16 -04:00
Bart van Strien fd514d8176 Update some more copyright notices
I am so good at using search/replace I definitely didn't need a second commit
for this.
2018-01-03 19:55:02 +01: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 7ff428b64f Fix love.graphics.newImage(compressedimagedata, settings) to respect the mipmaps boolean flag instead of always using the compressed texture's mipmaps if it has any. 2017-12-27 11:03:32 -04:00
Alex Szpakowski 065f4a8e9b Fix SpriteBatch:setDrawRange. 2017-12-24 22:31:58 -04:00
Alex Szpakowski f7b2598490 Remove unnecessary internal constructor arguments. 2017-12-24 22:08:57 -04:00
Alex Szpakowski a31b500b03 Simplify quad drawing code, and use glDrawElementsBaseVertex when available. 2017-12-24 22:05:10 -04:00
Alex Szpakowski 785902d8bd Fix windows build 2017-12-24 16:05:52 -04:00
Alex Szpakowski 3fb621af95 Always use a 16 bit index array for quad indices, with multiple draws when necessary. See issue #1356. 2017-12-24 15:54:03 -04:00
Alex Szpakowski ce46fa3ebe Remove PhysFS 2.x-specific code, it's no longer needed since we always have PhysFS 3. 2017-12-16 19:56:02 -04:00
Alex Szpakowski 70bf18182d Fix Image:getMipmapCount returning greater than 1 when a compressed texture is loaded without mipmaps in its source data but with mipmaps=true set. 2017-12-15 22:18:19 -04:00
Alex Szpakowski 3a8390ceff Fix a couple bugs with love.graphics.clear. 2017-12-10 14:40:08 -04:00
Alex Szpakowski 7354de2059 Add (low level) functionality to allow rendering 3D Meshes.
- Add love.graphics.setDepthMode(testcomparison, enablewrites).
- Add love.graphics.setMeshCullMode.
- Add love.graphics.setFrontFaceWinding.

Depth testing and depth writes require a depth buffer to work. The mesh cull mode controls whether front/back faces of a mesh are culled. The front face winding determines whether a clockwise or counterclockwise-oriented face in a mesh is considered front facing.

--HG--
branch : minor
2017-12-09 23:34:08 -04:00
Alex Szpakowski 915e6c8eec Fill-mode love.graphics.circle/ellipse draws a triangle fan from the center of the ellipse, instead of from an edge.
--HG--
branch : minor
2017-12-04 19:12:06 -04:00
Alex Szpakowski e099e57052 Cleaned up some internal love.graphics code.
--HG--
branch : minor
2017-12-03 23:04:40 -04:00
Alex Szpakowski cbcb1a8606 Allow a depth/stencil canvas to be active without a color canvas.
--HG--
branch : minor
2017-12-03 19:33:48 -04:00
Alex Szpakowski fccc6fa733 Increase the love.graphics max stack depth from 64 to 128.
--HG--
branch : minor
2017-11-28 22:41:01 +00:00
Alex Szpakowski 82553d793d Clamp colors in love.graphics.newMesh. I missed this one in my previous commit.
--HG--
branch : minor
2017-11-25 10:23:29 -04:00
Alex Szpakowski 6dea2ab714 Clamp all color arguments to [0, 1] in cases where values outside that range don't make sense (fixed-point color values & sRGB colors). Closes issue #1315.
--HG--
branch : minor
2017-11-21 19:49:52 -04:00
Alex Szpakowski b8c4b07edf Clean up unused temporary Canvases after a few frames.
--HG--
branch : minor
2017-11-13 19:45:18 -04:00
Alex Szpakowski 8672ff2272 Use a more efficient method of streaming automatically batched vertices on AMD Windows and Linux systems.
--HG--
branch : minor
2017-11-11 20:48:02 -04:00
Alex Szpakowski 7f88037d94 Move the implementation for Graphics::flushStreamDraws out of the opengl backend
--HG--
branch : minor
2017-10-26 21:05:15 -03:00
Alex Szpakowski e3fd489373 Abstracted lower level drawing code, moved all type-specific drawing code out of opengl backend, deleted obsolete files
--HG--
branch : minor
2017-10-26 20:58:19 -03:00
Alex Szpakowski 7ffb04f019 Fix windows build
--HG--
branch : minor
2017-10-25 23:23:41 -03:00
Alex Szpakowski 15cc540e4c Make internal vertex attribute code less OpenGL-specific.
--HG--
branch : minor
2017-10-25 23:12:39 -03:00
Alex Szpakowski b0c5bf2156 Fix build?
--HG--
branch : minor
2017-10-22 12:37:30 -03:00
Alex Szpakowski 7a2e52b12d Cleaned up some vertex data-related code.
--HG--
branch : minor
2017-10-22 12:33:47 -03:00
Alex Szpakowski 90cb3870e7 Fix error output when a shader stage fails to compile.
--HG--
branch : minor
2017-10-21 15:18:25 -03:00
Alex Szpakowski e5b0d96b27 Restructured some Shader code. Added runtime temporary caching and sharing of shader stages. Resolves issue #1235.
--HG--
branch : minor
2017-10-21 03:08:18 -03:00
Bart van Strien ba1d4dc0e9 Make VERTEX/PIXEL shader defines result in themselves
This means you can use VERTEX or PIXEL in your shader code without them
disappearing (and getting a vague error). It's still not necessarily a good
idea to use them as names, but at least it doesn't mysteriously break now.

--HG--
branch : minor
2017-10-04 14:05:09 +02: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 050be14547 Small graphics code cleanup
--HG--
branch : minor
2017-09-30 16:42:11 -03:00
Alex Szpakowski b838d0de54 Simplified an internal Variant constructor to be more intuitive to use.
--HG--
branch : minor
2017-09-30 10:39:24 -03:00
Alex Szpakowski 8068b0f1d4 Add variant of love.graphics.captureScreenshot which takes a Channel argument.
--HG--
branch : minor
2017-09-30 10:25:14 -03:00
Alex Szpakowski bdf961e174 Improve the error message when bad values are given to love.graphics.line. Resolves issue #1345.
--HG--
branch : minor
2017-09-24 16:19:39 -03: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 1b3745b58b Fix a crash on quit if a non-default shader is active when quitting.
--HG--
branch : minor
2017-09-23 20:23:01 -03:00
Alex Szpakowski 5f64737956 Shader:send now optionally accepts a Data object (with optional byte offset and size parameters). Resolves issue #1343.
Also changed the optional 'columnMajor' argument of the matrix variant of Shader:send and Transform:setMatrix to accept enum constants instead. Valid values are "row" and "column".

--HG--
branch : minor
2017-09-23 19:47:57 -03:00
Bart van Strien 77663ed847 Replace love.graphics.pop("all") with love.graphics.getStackDepth (resolves #1248 again)
The pop("all") api was a bit awkward, especially considering there's a
push("all") that does something else. I think any use case that benefited from
pop("all") benefits from getStackDepth just as much if not more. There is also
additional functionality, like being able to find the source of a mismatched
push/pop.

--HG--
branch : minor
2017-09-23 10:56:54 +02:00
Alex Szpakowski 4ee85e1793 love get* APIs which return tables with fields can optionally accept a table argument to fill in, instead of creating a new table.
--HG--
branch : minor
2017-09-22 19:47:55 -03:00
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
Bart van Strien 7dae80f552 Fix return type of ParticleSystem:getAreaSpreadIsRelativeDirection, remove optional parameters from ParticleSystem:setAreaSpread (resolves #1340)
I opted to remove the optional parameters altogether since they seemed oddly
out-of-place. They used to reset the values to defaults when not supplied, and
they also weren't returned by getAreaSpread(), so
setAreaSpread(getAreaSpread()) actually changed spread parameters.

The other option was to remove the separate getters/setters for
AreaSpreadIsRelativeDirection and AreaSpreadAngle, and fully rely on
setAreaSpread for these parameters, but the rest of the ParticleSystem API
tends to keep parameters separate.

--HG--
branch : minor
2017-09-12 12:40:21 +02:00
Bart van Strien 7dfbfbda79 Error if ParticleSystem's particle lifetime is set to a negative value (resolves #1339)
--HG--
branch : minor
2017-09-09 13:23:49 +02:00