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
Alex Szpakowski
b6ecdb7c78
SpriteBatches/Text objects/ParticleSystems: use glBufferData+glBufferSubData instead of glBufferData+glBufferData for orphaning streaming vertex data, on most platforms. Apparently some Android drivers have a problem with the latter.
...
--HG--
branch : minor
2017-09-03 23:41:35 -03:00
Alex Szpakowski
61a8ce6a66
Remove obsolete code and hopefully fix VS2013 build
...
--HG--
branch : minor
2017-09-03 18:46:33 -03:00
Alex Szpakowski
b4f8f08b70
Enable (when available) and improve performance of persistently mapped buffer path for the vertex/index buffers used with automatic batching.
...
--HG--
branch : minor
2017-09-03 18:23:54 -03:00
Alex Szpakowski
9bb105711a
Fix a Font texture memory leak when love.window.setMode is called (resolves issue #1338 ).
...
--HG--
branch : minor
2017-09-02 14:39:21 -03:00
Alex Szpakowski
a25cf3c432
Fix deprecation UI opacity when fading out.
...
--HG--
branch : minor
2017-09-01 18:10:57 -03:00
Alex Szpakowski
d35f69bcff
Fix the deprecation list UI to respect love.setDeprecationOutput.
...
--HG--
branch : minor
2017-08-27 21:56:07 -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
de28c6e6a8
Add the ability to have formally deprecated functions.
...
Functions which are deprecated will print out a message and show up in a small dialog on-screen, when they're first called. Deprecation output is disabled in fused mode by default, and can be modified with love.setDeprecationOutput(enable).
--HG--
branch : minor
2017-08-27 13:46:31 -03:00
Alex Szpakowski
0b68c92570
Rename some internal functionality to better match what it actually is.
...
--HG--
branch : minor
2017-08-25 22:42:03 -03:00
Alex Szpakowski
25afd740b4
Fast gamma correction functions in shaders are now more accurate. Always use the fast versions by default.
...
--HG--
branch : minor
2017-08-25 18:27:16 -03:00
Alex Szpakowski
7fdad7c010
Workaround for off-by-one line numbers in shader validation errors.
...
--HG--
branch : minor
2017-08-19 17:20:03 -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
fea9f82cfa
Remove the undocumented formatted variant of Text:set (Text:setf still exists). Resolves issue #1329 .
...
--HG--
branch : minor
2017-08-14 18:41:22 -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
b129d49a6c
Move Color.h from modules/graphics/ to common/
...
--HG--
branch : minor
2017-08-01 23:53:44 -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
68f1ab5f47
Check a couple more vendor strings to determine if an AMD driver is being used.
...
--HG--
branch : minor
2017-07-29 02:06:32 -03:00
Alex Szpakowski
d338f274ff
Update naming convention for builtin shader matrices.
...
- ClipSpaceFromLocal replaces TransformProjectionMatrix
- ViewSpaceFromLocal replaces TransformMatrix
- ClipSpaceFromView replaces ProjectionMatrix
- ViewNormalFromLocal replaces NormalMatrix
--HG--
branch : minor
2017-07-29 01:25:56 -03:00
Alex Szpakowski
d578c35f4a
Fix love.graphics.circle (thanks xenthral!)
...
--HG--
branch : minor
2017-07-25 08:05:46 -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
864147c38c
love.graphics: move more platform-independent code out of the opengl backend
...
--HG--
branch : minor
2017-07-22 23:34:39 -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
130ee7e1d9
Consolidated Image and Canvas dimension validation code.
...
--HG--
branch : minor
2017-07-11 20:38:47 -03:00
Alex Szpakowski
a129982e56
Fix Texture:get/setWrap for 3D textures.
...
--HG--
branch : minor
2017-07-09 21:06:54 -03:00
Alex Szpakowski
025201d0c2
Hopefully work around Array Texture intel GMA driver bug on windows (resolves issue #1265 ).
...
--HG--
branch : minor
2017-07-09 17:31:07 -03:00
Alex Szpakowski
34f25bd6c8
ESSL: always enable standard derivative functionality (dFdx, dFdy, fwidth) when available. Added 'shaderderivatives' graphics feature enum.
...
--HG--
branch : minor
2017-07-09 16:55:21 -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