Commit Graph

2390 Commits

Author SHA1 Message Date
Alex Szpakowski d8a68d6ce1 Updated iOS-specific graphics code to use the latest SDL changes. 2015-04-13 12:26:54 -03:00
Alex Szpakowski 2a482f8e98 Updated stb_image to version 2.0.3. 2015-04-12 15:48:25 -03:00
Alex Szpakowski f2ab02da13 Mostly fixed the precision of love's uniform matrices not matching between shader stages in OpenGL ES. 2015-04-10 13:00:36 -03:00
Alex Szpakowski 4c9b2105cd Updated the changelog 2015-04-08 22:44:16 -03:00
Alex Szpakowski 2844499ef7 Added the ability to have custom vertex attributes in Meshes (resolves issue #768.)
Added new love.graphics.newMesh variants: newMesh(vertexformat, vertices [, drawmode, meshusage]) and newMesh(vertexformat, numvertices [, drawmode, meshusage]).

Replaced the regular love.graphics.newMesh variants with newMesh(vertices [, drawmode, meshusage]) and newMesh(numvertices [, drawmode, meshusage]). To use an image or canvas with a mesh, use Mesh:setTexture.

vertexformat is a table with the following prototype:
{
  {attributename, datatype, components},
  {attributename, datatype, components},
  ...
}

Where attributename is the name of the vertex attribute (can be the built-in names 'VertexPosition', 'VertexTexCoord', or 'VertexColor', or a custom name for use in a vertex shader), datatype is the type of values used for the attribute ('float' or 'byte'), and components is the number of components in the vertex attribute (between 1 and 4.)

The vertex format is used to determine the layout of the vertices in the mesh, for example the 'regular' newMesh variants use this vertex format:
format = {
  {"VertexPosition", "float", 2},
  {"VertexTexCoord", "float", 2},
  {"VertexColor", "byte", 4},
}

The mesh usage parameter accepts the same constants as the spritebatch usage hint in love.graphics.newSpriteBatch - "dynamic", "static", and "stream".

Mesh:setVertex now sets *all* vertex attributes for a specific vertex in the Mesh.

Added Mesh:setVertexAttribute(vertexindex, attributeindex, attributevalue1, ...), which sets the values for a specific vertex attribute in a specific vertex in the Mesh (resolves issue #784.)

Added Mesh:getVertexFormat and Mesh:flush.

Added Mesh:setAttributeEnabled(attributename, enable) and Mesh:isAttributeEnabled(attributename), to enable or disable the use of a specific attribute when drawing the Mesh.

Added Mesh:attachAttribute(attributename, mesh), which makes the Mesh use a vertex attribute from another mesh when drawing the Mesh. This can be used to separate out vertex attributes which are updated at different rates into different meshes, and to share vertex data between multiple meshes.

Removed Mesh:setVertices, Mesh:getVertices, and Mesh:setVertexColors.
2015-04-08 22:24:17 -03:00
Alex Szpakowski f8ff50cfde Fixed Image:refresh for sRGB images when OpenGL ES 2 is being used. 2015-04-05 17:35:19 -03:00
Alex Szpakowski cf0968fc6d Avoid some VC++ compiler warnings 2015-04-02 00:28:09 -03:00
Alex Szpakowski 2a6bffaa5a Prevent sRGB and non-sRGB Canvas formats from being used together in multi-canvas rendering (MRTs), due to driver bugs. 2015-03-29 23:51:08 -03:00
Dermoumi Sid 6a07823224 Fixed shearing resetting transformations 2015-03-29 12:37:18 +01:00
Alex Szpakowski a17fed2a1e Fixed utf8.char. 2015-03-28 13:44:39 -03:00
Alex Szpakowski 3aafab9607 Hopefully fixed compilation in Windows. 2015-03-26 22:16:17 -03:00
Alex Szpakowski cffa899e03 Explicitly mention SDL in the error message caused by SDL subsystem initialization failure. 2015-03-26 14:51:47 -03:00
Alex Szpakowski 86d41620dd Replaced the mouse button constants ("l", "r", "m", etc.) with button numbers. 1 is the primary button, 2 is the secondary button, 3 is middle-mouse, etc. Resolves issue #1019. 2015-03-25 00:31:16 -03:00
Alex Szpakowski 78dd8bc547 Added love.touch.getPressure(touchid). Not useful on most touch-capable devices, but I do expect Apple's Force Touch to make it into iPhones in the near future. 2015-03-24 20:45:21 -03:00
Alex Szpakowski b8cb16dc95 Updated changelog 2015-03-23 13:43:11 -03:00
Alex Szpakowski a29b349014 Added love.math.compress(data, format [, level]) and love.math.decompress(compresseddata) / love.math.decompress(compressedstring, format).
Renamed the love.image CompressedData type to CompressedImageData.

love.math.compress returns a love.math CompressedData object which holds the newly compressed data. Currently supported formats are "lz4" and "zlib". Note that the formats are not file formats and don't compress filesystem hierarchies.
2015-03-23 11:28:14 -03:00
Alex Szpakowski 4d92d00aff Fixed compilation on OSX/Windows/iOS 2015-03-23 00:24:06 -03:00
Bart van Strien 37f04a7f3d Set LOVE_LINUX when compiling under BSD (see issue #867)
Not technically correct, but it seems to be working, sample size 1.
2015-03-22 19:57:00 +01:00
vrld f32d770cf6 Add BezierCurve:getSegment(t1, t2)
Returns a BezierCurve that corresponds to the curve-segment between t1 and t2
on the original curve.
2015-03-22 19:22:18 +01:00
vrld f7cb16be87 Merged in muddmaker/love-render-curve-segment (pull request #39)
Add BezierCurve:renderSegment
2015-03-22 19:16:24 +01:00
muddmaker 8ee2db3420 Fix typos 2015-03-22 10:16:12 -07:00
Bart van Strien cb02452c08 Verify both platform and endianness have been determined in configuration 2015-03-22 14:26:25 +01:00
muddmaker 3a54d4599a fix conflicts 2015-03-21 18:15:41 -07:00
Bart van Strien 95d9dfa801 Explicitly search for pkg-config in configure script 2015-03-21 21:49:17 +01:00
Alex Szpakowski e237ed2432 love.graphics.discard now accepts a table of booleans indicating which of the active canvases to discard (matches love.graphics.clear.) 2015-03-21 02:36:13 -03:00
Alex Szpakowski 163d059305 Moved most of the love.timer code out of the sdl implementation folder. 2015-03-20 00:55:14 -03:00
Alex Szpakowski d31168c0e0 Cleaned up some graphics code. 2015-03-20 00:16:36 -03:00
Alex Szpakowski 7741adc7b4 Switched back to zlib decompression for PNG images and fixed a memory leak issue when decompressing. 2015-03-19 17:08:44 -03:00
Alex Szpakowski 5138acaee5 Temporarily disabled zlib decompression for PNG images, in favour of LodePNG's built-in decompression code. 2015-03-19 14:41:15 -03:00
djcj 9d2a2832ab Disable static libraries by default in linux build 2015-03-18 11:28:01 +00:00
Alex Szpakowski a36dbc3d49 Only update the shader point size in OpenGL ES 2 when it's been modified, rather than before every draw. 2015-03-17 17:24:45 -03:00
Alex Szpakowski 4a8e5bd4db Avoid non-ASCII UTF-8 in message box text - SDL's X11 backend for message boxes doesn't properly support it yet (https://bugzilla.libsdl.org/show_bug.cgi?id=1658). 2015-03-17 11:54:52 -03:00
Alex Szpakowski d982f02634 Renamed File:eof to File:isEOF (closes issue #683.) 2015-03-17 01:13:29 -03:00
Alex Szpakowski 06ef263537 Added OpenGL debug groups for most graphics operations when love is built in debug mode for iOS. The Xcode frame capture tool uses them to create nice visual groups for OpenGL function calls. 2015-03-16 22:55:58 -03:00
Alex Szpakowski 14cbc91e7f Fixed a memory leak in love.graphics.newText. 2015-03-16 03:13:10 -03:00
Alex Szpakowski d00773b974 Updated GLAD for the latest GL and GLES extensions. 2015-03-15 23:45:08 -03:00
Bart van Strien bd271ce5cb Remove OpenGL as compile-time dependency on linux, SDL loads it at runtime (and also GLES, if applicable) 2015-03-15 21:37:04 +01:00
Bart van Strien b049dd0387 Also add *.hpp files to autotools sources lists 2015-03-15 21:36:35 +01:00
Alex Szpakowski 468127eed4 Added a variant of love.graphics.clear which accepts a color table argument for each active canvas, allowing it to clear active canvases to different colors without having to call love.graphics.setCanvas. 2015-03-15 15:15:21 -03:00
Alex Szpakowski 5bc5a2b780 Show the compatibility warning message box before creating the window and loading main.lua, so it will still display even if there are errors in main.lua.
Also snprintf is only supported in VS2015...
2015-03-15 12:34:40 -03:00
Bart van Strien 715cab4f6f Fix love.joystick.setGamepadMapping suffix overwriting bug
Previously, if "leftx" was mapped before "x", the latter mapping would overwrite
the former, or in general if any mapping was a suffix of another, it needed to
be mapped first.
2015-03-15 15:53:48 +01:00
Alex Szpakowski 44b9efb43e Added love.isVersionCompatible. Returns true if the running version of love is compatible with the specified version. 2015-03-13 19:26:09 -03:00
Alex Szpakowski a119e6a862 Added an optional spacing argument to love.graphics.newImageFont, allowing additional spacing (positive or negative) to be applied to all glyphs rendered using that font. 2015-03-11 18:28:22 -03:00
Alex Szpakowski b1f4beac56 Fixed the internal color mask state not being updated when love.graphics.setColorMask is called. 2015-03-10 01:13:39 -03:00
Alex Szpakowski 2e8f19930c Fixed love.graphics.stencil 2015-03-09 23:08:42 -03:00
Alex Szpakowski 52b2701cf0 Removed love.graphics.clearStencil. love.graphics.stencil now clears the stencil buffer unless true is passed as an optional second argument ('keep the existing contents'.) 2015-03-09 23:05:29 -03:00
Alex Szpakowski b76b7bac8b Added support for a few more mouse buttons (via "x3", "x4", and "x5" button constants.) 2015-03-07 23:28:58 -04:00
Alex Szpakowski 4ef0d257e9 Added an optional font hinting argument to love.graphics.newFont / love.font.newRasterizer when loading TrueType fonts. Resolves issue #963.
Accepted values are "normal", "light", "mono", and "none".
2015-03-07 22:05:37 -04:00
Alex Szpakowski afcad4defc Added new flag t.accelerometerjoystick to love.conf (true by default.) When set to false on mobile, the device's accelerometer will not show up as a joystick even if the joystick module is loaded.
This can reduce CPU usage if you don't use the accelerometer but you don't want to disable the joystick module entirely.
2015-03-07 15:36:53 -04:00
Alex Szpakowski 7e99ea6839 Added a boolean argument to love.mousemoved indicating whether the event came from a touch press (love.mousepressed and love.mousereleased already have it.) 2015-03-07 00:41:18 -04:00