Commit Graph

81 Commits

Author SHA1 Message Date
Alex Szpakowski 9313484fcc Cleaned up graphics.lua a bit
--HG--
branch : minor
2015-02-28 00:11:27 -04:00
Alex Szpakowski 67aede6bc0 Merged default into minor
--HG--
branch : minor
2015-02-02 01:13:21 -04:00
Alex Szpakowski ea2e45f4e2 Renamed love.mouse.setRelative to love.mouse.setRelativeMode, removed some unused OpenGL code. 2015-01-31 23:17:37 -04:00
Alex Szpakowski 665cdc4ae7 Moved the default Font logic from the graphics.lua script to the Graphics and Font module C++ code. Moved love.graphics.setNewFont from the graphics.lua script to the Graphics module Lua wrapper code. Moved the Vera.ttf data from the graphics.lua script to its own file inside the Font module. 2015-01-31 01:10:38 -04:00
Alex Szpakowski 72f98b9c8f love's overloaded love.graphics.print and love.graphics.printf functions now use proper tail calls, which fixes the filename and backtrace given if those functions cause an error. 2015-01-30 22:14:46 -04:00
Alex Szpakowski 5df56d041a Added GLSL ES 1.00 (OpenGL ES 2) shader support.
--HG--
branch : minor
2015-01-20 22:31:54 -04:00
Alex Szpakowski a7e4148869 Merged default into minor
--HG--
branch : minor
2015-01-16 15:47:26 -04:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04:00
Alex Szpakowski 8edb90a719 Added support for loading BMFont bitmap font files with love.graphics.newFont (see issue #190.) Some esoteric BMFont features are not supported.
Moved the Font module Lua wrapper code out of the freetype implementation folder.

--HG--
branch : minor
2014-09-28 16:00:40 -03:00
Alex Szpakowski fffbd3ecab Merged default into minor
--HG--
branch : minor
2014-09-18 02:15:20 -03:00
Alex Szpakowski 417173b43a GLSL precision qualifiers (lowp, mediump, highp) can now be used for variables in shader code on desktops without causing a compile error, although they do nothing. 2014-09-16 22:34:22 -03:00
Bart van Strien 97cacf1b2d Merge default into minor
--HG--
branch : minor
2014-09-03 18:11:20 +02:00
Alex Szpakowski c502847802 Enable strict mode for shaders on some nvidia drivers. Should hopefully prevent some issues where nvidia GLSL compilers let things slide that should be illegal. 2014-08-31 00:51:54 -03:00
Alex Szpakowski 626701fc2b Merged default into minor
--HG--
branch : minor
2014-08-26 23:23:17 -03:00
Alex Szpakowski 1449a81bdf Removed some dead code. 2014-08-26 22:16:01 -03:00
Alex Szpakowski 3a51f0ad08 Changed the love.graphics internal code to always use a default shader when none is set externally, and replaced the deprecated OpenGL vertex attribute code with the equivalent generic vertex attribute functions.
This will simplify the code and make it more maintainable when OpenGL ES 2+ support is added, compared to using the deprecated VA functions on desktop GL and the generic VA functions on GLES.

--HG--
branch : minor
2014-08-26 03:24:42 -03:00
Alex Szpakowski 3792dee4b4 Backout changeset 57172a7f03452a6b07f346e850f3e1020e230f46 2014-06-05 14:59:29 -03:00
Alex Szpakowski e9e303c1e8 Changed embedded Lua scripts to be included in the love source via C++11's raw string literals instead of a generated header file. Removed auto.lua.
As a result, love can be compiled immediately after editing an embedded Lua script.

Visual Studio 2013 or newer is required for C++11 raw string literals in Windows.
2014-06-05 13:42:03 -03:00
Alex Szpakowski 4d0bbb97d8 Fixed Lua pattern matching for detecting the 'position' and 'effect' shader functions (thanks lpghatguy!) 2014-05-31 00:42:18 -03:00
Alex Szpakowski 0372977dfa Backout changeset 6dd72101871f163ee0e644c751f80773d45f339f
The change should only be done for GLES, not desktop GL - their specifications differ on this.
2014-05-03 22:21:45 -03:00
Alex Szpakowski 5428a5d75f Backout changeset b3928e24add23da69dcd90c34985cd6a05454be0 2014-05-03 22:07:32 -03:00
Alex Szpakowski 4bc96f1bf6 Internally compose and pass an array of shader source codes to OpenGL, instead of relying on #line to make sure the line number is correct for shader error messages (resolves issue #882) 2014-05-03 21:43:20 -03:00
Bart van Strien 9972153696 Use '#line 1' instead of '#line 0' in shader sources, for compatibility with GLES (fixes #882) 2014-05-03 14:50:08 +02:00
Alex Szpakowski f65e9826d9 Disabled shader code for instancing 2014-03-29 17:51:33 -03:00
Alex Szpakowski c5c788e976 Added a built-in variable readable in shaders: ‘love_ScreenSize’. Its x and y components contain the width and height of the current viewport. Resolves issue #841. 2014-01-27 02:58:34 -04:00
Alex Szpakowski 73f1ce0d40 Added instancing support to Meshes via Mesh:setInstanceCount. Added a new built-in variable to vertex shaders: int love_InstanceID.
love.graphics.draw(mesh) will draw the mesh instancecount times, using hardware instancing when available. The only way to draw individual instances differently from each other is to use the love_InstanceID variable in a vertex shader.

Added love.graphics.isSupported(“instancing”). Hardware instancing is supported if true, otherwise a (slower) pseudo-instancing fallback is used internally when drawing instanced meshes.
2014-01-21 06:01:50 -04:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -04:00
Alex Szpakowski aa69a695d3 Canvases can now be used in SpriteBatches, ParticleSystems, and Meshes (resolves issue #782).
Canvases and Images are now subclasses of the new Texture class.
Added setTexture and getTexture methods for Meshes, ParticleSystems, and SpriteBatches (the old set/getImage methods are deprecated but not removed.)
Canvas texture coordinates are no longer flipped.
2014-01-03 17:07:12 -04:00
Alex Szpakowski d815374a9b Renamed the 'ModelViewMatrix' and 'ModelViewProjectionMatrix' built-in shader variables to 'TransformMatrix' and 'TransformProjectionMatrix', respectively. 2013-08-16 03:17:55 -03:00
Alex Szpakowski 123889dfed Converted code for Shader:send from Lua to C++ 2013-05-21 20:41:26 -03:00
Alex Szpakowski 0130b726de Improved error messages when sending bad values to a shader (also issue #587) 2013-04-24 23:19:37 -07:00
Alex Szpakowski 63ac9aa52a De-obfuscated more shader error message tracebacks 2013-03-27 19:44:50 -03:00
Alex Szpakowski a55c7e871e fixed canvas:clear() when multi-canvas rendering is active, changed some names and wording
--HG--
branch : MRTs
2013-03-26 04:58:43 -03:00
Alex Szpakowski 2ea065c68b Added MRT support to canvases via love.graphics.setCanvases(c1, c2, ...), and an 'effects' callback function in shaders.
- Simultanious rendering to multiple canvases requires all canvases to be the same size (limitation of pre-GL3.0 framebuffers)
- love.graphics.isSupported("mrtcanvas") was added
- love_Canvases[n] (0-based array of active canvases) can be written to in pixel shaders in the 'effects' callback function
- everything drawn to multiple canvases at once will be duplicated to all canvases if no shader is active or the standard 'effect' shader function is used

--HG--
branch : MRTs
2013-03-24 02:20:15 -03:00
Alex Szpakowski 9e9eb42f1d Fixed filedata not being cleaned up when love.image.newImageData(filepath) fails 2013-03-19 09:01:15 -03:00
Alex Szpakowski f3290d84b7 Improved error handling and error messages when love.graphics.newShader fails 2013-03-18 22:55:41 -03:00
Alex Szpakowski 991b15d670 More renaming of "fragment" to "pixel" 2013-03-18 04:07:18 -03:00
Alex Szpakowski 2d7dd87eb5 Removed PixelEffect compatibility functions (love.graphics.newPixelEffect is now love.graphics.newShader, etc)
Also removed love.graphics.isSupported("pixeleffect") in favor of love.graphics.isSupported("shader")
2013-03-04 14:01:04 -04:00
Alex Szpakowski 96161c66f6 Updated copyright text for the new year 2013-02-05 05:32:49 -04:00
Alexander Szpakowski e24d721381 Renamed all instances of 'ShaderEffect' (previously 'PixelEffect') to 'Shader'. 2013-01-16 07:21:41 -04:00
Alexander Szpakowski 69dc6c76e8 Better boolean shader extern support 2013-01-11 00:47:15 -04:00
Alexander Szpakowski ca1a9caf91 Added boolean value support to ShaderEffect:send 2013-01-11 00:21:28 -04:00
Alexander Szpakowski 3a9659b608 More minor graphics.lua cleanup 2013-01-09 01:01:13 -04:00
Alexander Szpakowski f1e72efd30 Cleaned up graphics.lua script a bit 2013-01-08 23:59:48 -04:00
Alexander Szpakowski 609ef2c4e4 Format luaL_error strings properly in ShaderEffect lua wrapper code 2013-01-07 06:39:33 -04:00
Alexander Szpakowski 88af7239c3 Removed unnecessary tabs from empty lines 2013-01-07 06:21:15 -04:00
Alexander Szpakowski 0968fa6f11 More cleanup and some overdone comments 2013-01-05 15:59:01 -04:00
Alexander Szpakowski 37191a5953 Minor cleanup 2013-01-04 05:05:25 -04:00
Alexander Szpakowski dcf9825226 Uniform value defines now exist in both the vertex and fragment shaders 2013-01-04 01:45:46 -04:00
Alexander Szpakowski c13b1fb03b Changed vertex shader callback function name from 'transform' to 'position', added more vertex shader defines (some to make it easier to eventually have a GLES2 backend), hopefully updated Visual Studio project with changed filenames 2013-01-04 01:20:38 -04:00