Commit Graph

3106 Commits

Author SHA1 Message Date
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
Alex Szpakowski d70fe5cb89 Merged in TannerRogalsky/love-pristine/update_comment_function_name (pull request #84)
function name has changed and comment is out of date

--HG--
branch : minor
2017-02-19 15:44:03 +00: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
Alex Szpakowski 28b2192ef5 Update Xcode project
--HG--
branch : minor
2017-02-11 15:14:39 -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
Alex Szpakowski ded5d4d413 Updated license.txt
--HG--
branch : minor
2017-02-11 00:02:07 -04: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
Bart van Strien 2b4cd99c96 Exclude windows folder of glslang on linux
--HG--
branch : minor
2017-02-04 20:18:42 +01:00
Bart van Strien 6db676d149 Sort changelog
--HG--
branch : minor
2017-01-31 15:46:05 +01:00
Bart van Strien edbd4309f8 Merge default into minor
--HG--
branch : minor
2017-01-31 15:43:36 +01:00
Bart van Strien ab7b3a8125 Update changelog 2017-01-31 15:32:42 +01: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
Alex Szpakowski 4a3319245b Fix Windows build
--HG--
branch : minor
2017-01-28 23:19:45 -04:00
Alex Szpakowski 673bcf4a7f Updated CMakeLists.txt
--HG--
branch : minor
2017-01-28 21:39:30 -04:00
Alex Szpakowski 13af754d3d Move most of Text and Video love.graphics classes out of the opengl subfolder.
--HG--
branch : minor
2017-01-28 21:37:09 -04:00
Alex Szpakowski d990044288 love.graphics internal Buffer objects are no longer OpenGL-specific.
--HG--
branch : minor
2017-01-28 19:26:57 -04:00
Alex Szpakowski 470098b7e6 Shader code cleanup
--HG--
branch : minor
2017-01-27 23:19:04 -04:00
Alex Szpakowski e360346c21 Fix Windows build
--HG--
branch : minor
2017-01-22 23:39:32 -04:00
Alex Szpakowski 7f9ec24dae Updated the changelog
--HG--
branch : minor
2017-01-22 22:50:37 -04:00
Alex Szpakowski c764f9f206 Support instancing on more systems. Note that GLSL 3 may not be supported everywhere that instancing is, and love_InstanceID requires GLSL 3 (but instanced vertex attributes do not).
--HG--
branch : minor
2017-01-22 21:18:06 -04:00
Alex Szpakowski bea7cfdaab Add low-level hardware instancing support to Meshes.
Add “instancing” Graphics Feature constant.

Add love.graphics.drawInstanced(mesh, instancecount, x, y, …) which draws the mesh multiple times in a single draw call. Each instance of the mesh will appear in the exact same spot unless one of the following are used:

- Add an optional vertex attribute step type argument to Mesh:attachAttribute. “pervertex” is the default. “perinstance” causes the attribute to be per-instance instead of per-vertex, when the mesh is drawn.

- Add love_InstanceID as a built-in read only int variable in GLSL 3 vertex shaders. It is always 0 except when a Mesh is drawn with more than 1 instance specified in the draw call. It can be used to manually compute or index into per-instance values in a shader.

--HG--
branch : minor
2017-01-22 20:52:11 -04:00
Alex Szpakowski 731b5d5cf0 Added support for GLSL 3 shaders (GLSL 3.30 and GLSL ES 3.00).
To use GLSL 3 in a shader, the first line of the shader has to be: #pragma language glsl3

glsl1 is the default language.

Added “glsl3” graphics feature as part of the table returned by love.graphics.getSupported().

Added love.graphics.validateShader(boolean gles, shadercode). It returns a boolean along with an error string if the shader code has errors for its target language and platform (gles or desktop).

Implemented support for Core Profile OpenGL 3.3 in love.graphics.

--HG--
branch : minor
2017-01-22 18:54:04 -04:00
Alex Szpakowski a6669a8bb2 Merge default into minor
--HG--
branch : minor
2017-01-21 12:06:35 -04:00
Alex Szpakowski f45c6a0d74 Fix a crash related to love.graphics.push and love.window.setMode. 2017-01-21 12:03:43 -04:00