Commit Graph

2315 Commits

Author SHA1 Message Date
Alex Szpakowski c36a53fdcb Add new non-readable Canvas formats: depth16, depth24, depth32f, depth24stencil8, and depth32fstencil8.
--HG--
branch : minor
2017-04-11 18:34:04 -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 ac00329ddd Fix wrong default reference angle for WeldJoint/PrismaticJoint/RevoluteJoint (fixes #1258)
--HG--
branch : minor
2017-04-07 12:19:29 +02:00
Bart van Strien f70ad12d3e Expose love.event.poll_i
Now love.event.poll just returns love.event.poll_i, instead of returning a new
c function every call. This means love no longer creates garbage each frame
(with an empty project).

See pull request #81 for details, and an alternative fix. Thanks @bjornbytes
for the pull request, and for finding this issue.

Note: in the pull request I also mentioned love.filesystem.lines/File:lines. I
haven't "fixed" those since they use actual closures.

--HG--
branch : minor
2017-04-07 12:04:58 +02:00
Alex Szpakowski a854602344 Fix a crash when a Source stops playing.
--HG--
branch : minor
2017-04-02 13:32:25 -03:00
Alex Szpakowski 60f898af67 Fix a crash when loading .pvr compressed texture.
--HG--
branch : minor
2017-04-01 21:20:08 -03:00
Alex Szpakowski f8c58c54c8 love.math.randomNormal can be JIT-compiled
--HG--
branch : minor
2017-04-01 21:19:19 -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 7fdea9a5d1 Merged in lognz/love-minor2/particle system new features (pull request #85)
Particle System New Features

--HG--
branch : minor
2017-03-11 14:52:01 +00:00
lognz 9f2ac304e3 Corrected angle not factoring setDirection() into spawn angle
--HG--
branch : particle system new features
2017-03-11 08:13:12 +00:00
lognz 0f99f261e0 Particle System new features
2 new Particle System Distribution types:

borderellipse - spawns new particles around the border of an elllipse shape defined by dx,dy
borderrectangle - spawns new particles around the border of a rectangle shape defined by dx, dy

New functions:

getAreaSpreadAngle()
getAreaSpreadIsRelativeDirection()
setAreaSpreadAngle(angle in radians)
setAreaSpreadIsRelativeDirection(boolean)

setAreaSpread(distribution, x, y, (optional)angle, (optional)isRelativeDirection)

- angle - defaults 0. In radians the angle to rotate the entire area spread distribution
- isRelativeDirection - defaults false. When false, particles will travel in the direction defined by setDirection(). When true, particles will travel away from the center of the area spread shape

Demo: http://i.imgur.com/sBQ9Xhr.png

The new angle parameter should address: https://bitbucket.org/rude/love/issues/1172

--HG--
branch : particle system new features
2017-03-11 01:54:26 -06:00
lognz 09b757f018 2 new area particle distributions: borderellipse and borderrectangle
--HG--
branch : particle system new features
2017-03-10 06:42:52 -06:00
Alex Szpakowski a8e4db8e1e Clamp color arguments to [0, 1] in cases where we don’t support values outside of that range internally.
--HG--
branch : minor
2017-03-09 21:15:56 -04:00
Alex Szpakowski 1a9262dda9 Fix compilation on iOS. Fix shader compilation on OpenGL ES. Fix (harmless) GL errors on OpenGL ES 2. Resolves issue #1266.
--HG--
branch : minor
2017-03-09 20:46:26 -04:00
Alex Szpakowski 5ce084051a Fix for gles shader profiles when validating shaders.
--HG--
branch : minor
2017-03-09 19:38:51 -04:00
Alex Szpakowski 856a4e60ae Declare VaryingTexCoords and love_ScreenSize as highp when supported.
--HG--
branch : minor
2017-03-07 21:20:44 -04:00
Alex Szpakowski ceb9cd1c0b Rename internal “GLSLES” references to “ESSL”.
--HG--
branch : minor
2017-03-07 21:03:23 -04: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 074107b01d ImageData:paste can copy between ImageData of different formats. Resolves issue #1249.
--HG--
branch : minor
2017-03-03 22:10:10 -04:00
Alex Szpakowski cb9aa857d7 Don’t try to create the standard/default array texture shader if array textures are not supported.
--HG--
branch : minor
2017-03-01 21:19:37 -04:00
Alex Szpakowski 12ede289b4 Fix memory leak
--HG--
branch : minor
2017-02-26 20:22:03 -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 a3454aa205 Use a simpler default video shader.
--HG--
branch : minor
2017-02-26 17:22:08 -04:00
Alex Szpakowski 9e94f5a375 love.graphics.drawLayer(canvas, …) now errors if the Canvas is currently active as a render target (matches behaviour of love.graphics.draw).
--HG--
branch : minor
2017-02-26 17:15:26 -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 9ba7234f14 Implicitly declare VaryingTexCoord and VaryingColor when void effect() is used.
--HG--
branch : minor
2017-02-25 18:02:06 -04:00
Alex Szpakowski ff8358a979 Removed void effects(…) pixel shader prototype. Added void effect(). Allows calling love.graphics.draw with textures of different types with a custom shader without having an extra sampler2D.
effect() takes no arguments and returns nothing, you are responsible for assigning a value to either love_PixelColor or love_Canvases[n] in the function. You can declare ‘MainTex’, which will be whatever texture is used with any Drawable drawn with love.graphics.draw. You can also declare ‘VaryingColor’ and ‘VaryingTexCoord’, which are passed down from the vertex shader by love automatically. love_PixelCoord is also available.

--HG--
branch : minor
2017-02-25 17:52:27 -04:00
Alex Szpakowski f3f6b10ac8 Clean up glVertexAttribPointer calls a bit.
--HG--
branch : minor
2017-02-25 17:23:00 -04:00
Alex Szpakowski b7dde8712a Fix drawing with >= 16k sprites in a spritebatch on desktops.
--HG--
branch : minor
2017-02-20 15:46:43 -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 5c35e3e137 function name has changed and comment is out of date
--HG--
branch : update_comment_function_name
2017-02-19 10:42:35 -05:00
Alex Szpakowski 97789b18c0 Only use opengl debug groups if the LOVE_GRAPHICS_DEBUG environment variable is set to 1.
--HG--
branch : minor
2017-02-12 17:58:28 -04:00
Alex Szpakowski df540cedea Enable OpenGL debug group markers outside of iOS
--HG--
branch : minor
2017-02-12 16:40:54 -04:00
Bart van Strien 03b863d788 Simplify love.audio's Pool class
Move most logic back to Source. Pool now simply contains a list of playing
sources and a mutex. Also gets rid of the pause/pauseAtomic duplication in
Source, since it can now request a lock from Pool itself.

--HG--
branch : minor
2017-02-11 21:41:22 +01:00
Alex Szpakowski 7b6e1523b4 Very minor style cleanup
--HG--
branch : minor
2017-02-11 15:47:30 -04:00
Alex Szpakowski 218950fe76 Potentially fix compilation for MSVC
--HG--
branch : minor
2017-02-11 15:18:04 -04:00
Bart van Strien 42b8249b60 Remove extra whitespace
--HG--
branch : minor
2017-02-11 20:12:44 +01:00
Bart van Strien cbaf9e047b Merged in rcoaxil/love-patches/minor (pull request #75)
EFX implemented

Approved-by: Bart van Strien
Approved-by: Alex Szpakowski

--HG--
branch : minor
2017-02-11 19:04:53 +00:00
Raidho 8572a33880 Prettifyed the code exploiting inheritance rules
added missing comma, added missing `override`

--HG--
branch : minor
2017-02-10 18:36:47 +03:00
Raidho 6ea1ebde9c Data:clone ported to minor
minor tweaks

--HG--
branch : minor
2017-02-10 06:19:53 +03:00
Tanner Rogalsky bc6a2db22f Do not attempt to free pointer to scratch buffer
--HG--
branch : minor
2017-02-07 15:23:53 -05:00
Raidho 94b4d2bdef naming updated, Filters patched up
--HG--
branch : minor
2017-02-07 03:15:05 +03:00
Alex Szpakowski f2597168a2 Fix text object drawing and a bug in stream buffers used in autobatching
--HG--
branch : minor
2017-01-30 22:11:26 -04:00
Alex Szpakowski a3ae0e2279 Fix love.graphics.points when no per-point colors are given
--HG--
branch : minor
2017-01-29 17:47:29 -04:00
Alex Szpakowski 98493d9844 Fix rendering to only use glDrawElementsInstanced when necessary
--HG--
branch : minor
2017-01-29 16:13:41 -04:00
Alex Szpakowski 7d7f8e0a92 Mark classes as ‘final’
--HG--
branch : minor
2017-01-29 02:06:17 -04: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
Alex Szpakowski c0e66eba83 Move backend-agnostic Mesh and SpriteBatch code out of the opengl implementation folder.
--HG--
branch : minor
2017-01-29 01:05:20 -04:00
Alex Szpakowski 3616470a0a Move love.graphics Image wrapper code out of the opengl subfolder
--HG--
branch : minor
2017-01-29 00:20:16 -04:00