Commit Graph

216 Commits

Author SHA1 Message Date
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 f3bd944cf5 Reduced the RAM and VRAM space taken up by TrueType font glyphs by 1/2. 2013-12-31 20:15:55 -04:00
Alex Szpakowski a00c006c44 The graphics viewport is now properly restored when switching from an active Canvas to no Canvas (resolves issue #817) 2013-12-30 23:52:46 -04:00
Alex Szpakowski d0d629a314 Fixed line width after love.graphics.scale with negative numbers (resolves issue #808) 2013-12-18 03:15:44 -04:00
Alex Szpakowski d9da19d665 Error for misspelled / invalid window attributes in love.window.setMode (resolves issue #736) 2013-10-20 13:17:57 -03:00
Alex Szpakowski c63e2ec624 Merged default into Mesh
--HG--
branch : Mesh
2013-09-29 04:58:26 -03:00
Alex Szpakowski 1e696c4505 Added Mesh objects and love.graphics.newMesh. Mesh objects are similar to Geometry but they're drawables (the relationship between meshes and images is the opposite of geometry and images.)
Removed Geometry objects and re-added Quads.

example:
local vertices = {{0, 0, 0, 0}, {100, 0, 1, 0}, {100, 100, 1, 1}, {0, 100, 0, 1}}
mesh = love.graphics.newMesh(vertices, image, "fan")
..
love.graphics.draw(mesh, 0, 0)

--HG--
branch : Mesh
2013-09-28 18:26:47 -03:00
Alex Szpakowski 1be8ac5be4 Removed some unused functions and fixed up some wrap_ headers 2013-09-26 00:48:48 -03:00
Alex Szpakowski bcee9a222b Made some float/int/unsigned char conversions explicit, fixed ParticleSystem:getColors, fixed love.mouse.isDown with x1 and x2 buttons 2013-09-26 00:36:50 -03:00
Alex Szpakowski 5de43a7207 The Vertex struct is now recognized as POD by C++, also fixed the name to be consistent with other love structs 2013-09-24 11:09:18 -03:00
Alex Szpakowski 113ed1cfe7 Merged SDL2 changes from bartbes/love-experiments/SDL2 into default.
- Added love.system module, including clipboard functions.

- Added custom hardware cursors (love.mouse.newCursor, love.mouse.setCursor.)

- Revamped love.joystick:
-- added Joystick objects and moved love.joystick functions which operated on individual joysticks to methods on the Joystick objects.
-- Added love.joystick.getJoystick and love.joystick.getJoystickCount.
-- Added events for when joysticks are connected and disconnected.
-- Added 'Gamepad' methods to Joystick objects: Joystick:isGamepad, Joystick:getGamepadAxis, and Joystick:isGamepadDown. They're a common abstraction for xbox controller-like joystick across operating systems.

- Added monitor choosing support and "fullscreen desktop" mode to love.window.

- Moved unicode text input events to their own callback function (love.textinput), removed the key repeat functions from love.keyboard and made the second argument of love.keypressed a boolean saying whether the keypress was a repeat.

- liblove now works with love.window and love.graphics in OS X
2013-08-25 16:51:42 -03:00
Alex Szpakowski acfce1bf47 love.graphics.printf errors if the wrap limit parameter is negative (resolves issue #706) 2013-08-18 13:17:53 -03:00
vrld be205544b3 Issue #659: Add line joins.
Added:

love.graphics.setLineJoin(linejoin)
linejoin = love.graphics.getLineJoin()

where linjoin is one of:

- none
- miter
- bevel

Bevel and miter drawing is slightly faster than the 0.8 default (miter), while
the `none` join mode will be slower when overdraw is enabled.
2013-08-07 21:48:21 +02:00
Alex Szpakowski d7802b053b Removed love.graphics.setAlphaTest: incompatible with OpenGL ES 2+, core OpenGL 3+, and Direct3D 10+. Shaders can accomplish the same things and more. 2013-08-01 12:55:46 -03:00
Alex Szpakowski f41a2ed910 Reverted commit 8c64a0c (love.graphics.setCanvas(nil) erroring) 2013-07-19 19:53:39 -03:00
Alex Szpakowski 57aa632841 Added love.graphics.getMaxImageSize 2013-07-17 00:35:25 -03:00
Alex Szpakowski 91e4feeca0 Fixed justify AlignMode 2013-07-10 20:36:20 -03:00
Alex Szpakowski 454ba9d968 love.graphics.newGeometry now takes an optional draw mode argument ("fan", "strip", or "triangles".) "fan" is the default.
This allows for more diverse and complex Geometries, provided the lover understands how to use each mode. See http://escience.anu.edu.au/lecture/cg/surfaceModeling/image/surfaceModeling015.png

Changed love.graphics.newGeometry to optionally accept vertices as individual arguments instead of just a table of vertices (resolves issue #651).
Changed Geometry:setVertex to optionally accept a table containing x,y,u,v,r,g,b,a instead of just individual arguments.

Added Geometry:set/getDrawMode.

Removed the convex-check in love.graphics.newGeometry (all geometry modes have at least some form of concavity support, lovers can do their own check if needed with love.math.isConvex.)

Added an optional "vertex map" table argument to love.graphics.newGeometry (AKA a vertex index array / element array in graphics programming lingo.)
This allows lovers to change the order in which the vertices are used when drawing, or re-use a single vertex multiple times for different parts of the Geometry.
This is especially useful in the "triangles" Geometry draw mode. The vertex map lets you draw very complex (and concave) shapes / meshes without duplicating vertex data.

Added Geometry:set/getVertexMap.
2013-07-10 15:34:10 -03:00
Alex Szpakowski 2426d97450 Fixed justify printf Align Mode (issue #635) 2013-06-18 23:16:01 -03:00
Alex Szpakowski f25efcc8af Improved performance and reduced temporary memory usage of love.graphics.newScreenshot and Canvas:getImageData 2013-06-15 22:07:16 -03:00
Alex Szpakowski 0a1c90f2d7 Removed love.graphics.setLine and love.graphics.setPoint.
Both functions are redundant (setLineStyle+setLineWidth and setPointStyle+setPointSize do the same thing) and have misleading names.
2013-06-14 10:12:09 -03:00
Alex Szpakowski 8718e064e0 Fixed love.graphics.print[f] truncating strings with embedded zeros 2013-06-13 17:37:14 -03:00
Alex Szpakowski d286f78ec7 Improved error messages when canvas/image creation fails because the size is too big for the system 2013-06-09 18:24:19 -03:00
Alex Szpakowski 35984790e5 Added a way for love's reference-counted objects to be released more safely in some situations (e.g. setters) 2013-06-09 02:42:33 -03:00
Alex Szpakowski c0998cd996 Fixed love.graphics.setScissor when love.graphics.setCanvas is called directly after a setScissor call 2013-06-07 03:31:30 -03:00
Alex Szpakowski 6c6cb270de Fixed Canvas:clear 2013-05-30 04:31:32 -03:00
Alex Szpakowski 0e9d73503c Stencil buffers are now created and attached to canvases on-demand, instead of always on canvas creation.
saves VRAM when stencils aren't used in canvases.
2013-05-22 23:08:21 -03:00
Alex Szpakowski ac094f9437 Fixed love.graphics.newScreenshot to always read from the main framebuffer, even when a canvas is bound 2013-05-22 19:18:11 -03:00
Alex Szpakowski 264948690c Renamed BlendMode "none" to "replace" and updated changelog 2013-05-22 04:26:29 -03:00
Alex Szpakowski aa59761177 Fixed smooth lines with love.graphics.origin() after love.graphics.scale 2013-05-12 16:13:32 -03:00
Alex Szpakowski c1cbd610e6 Fixed the default blend mode (and other related state) 2013-05-12 05:49:00 -03:00
Alex Szpakowski ff77eb4b29 Added love.window (issue #6.) All window-related functions have been moved from love.graphics to love.window.
love.graphics.setCaption has been renamed to love.window.setTitle.
2013-05-10 22:32:15 -03:00
vrld 13dd8d3199 Faster (and less WTF-ish) computation of current pixel size for line drawing. 2013-05-10 19:09:17 +02:00
Alex Szpakowski 63404f7097 Added love.graphics.getRendererInfo(infotype). Useful for creating more informative error reports and advanced debugging.
Returned string can be highly system-dependent, so don't rely on its output!

infotype can be "name", "version", "vendor", or "device"
2013-05-05 16:47:42 -03:00
Alex Szpakowski 3bf43dadd8 Renamed CompressedData:getNumMipmaps to CompressedData:getMipmapCount; Improved type-checking error messages for some functions which expect function arguments 2013-05-02 17:26:50 -04:00
Alex Szpakowski 8b50dd499b Removed now-unnecessary optional filter parameters from love.graphics.newImageFont 2013-04-28 18:15:03 -07:00
Alex Szpakowski ad2239aaaf Error instead of crash when love.graphics.newScreenshot fails 2013-04-28 11:12:19 -07:00
Alex Szpakowski a5eaffe625 Disabled opengl debug output until it can be improved & made optional 2013-04-23 16:47:22 -07:00
vrld 71317c4359 Add Geometries (replaces Quads).
A Geometry is a collection of vertices describing a non self-intersecting
(simple) polygon. In addition to screen coordinates, the vertices have
attributes for texture coordinates (s,t) and color (r,g,b,a).

It can be used as a quad, to display distorted images, or anything in between.

Added:
^^^^^^

-- geometry from table, where table has the format:
-- info = {
-- {x,y, s,t, [r = 255, g = 255, b = 255, a = 255]}
-- {x,y, s,t, [r = 255, g = 255, b = 255, a = 255]}
-- ...
-- }
geom = love.graphics.newGeometry(info)

-- convenience wrapper for quads (same as before)
geom = love.graphics.newQuad(x,y, w,h, sw,sh)

-- retrieve vertex i (1-indexed)
x,y,s,t,r,g,b,a = geom:getVertex(i)

-- set vertex i (1-indexed)
geom:setVertex(i, x,y, s,t, [r,g,b,a])

-- flip geometry
geom:flip(x, y)


Renamed:
^^^^^^^^

love.graphics.drawq() -> love.graphics.drawg()


Removed:
^^^^^^^^

quad:setViewport()
quad:getViewport()
2013-04-21 18:53:13 +02:00
Alex Szpakowski bf6d1c258b Misc. code cosmetics and improvements 2013-04-18 02:14:35 -03:00
Alex Szpakowski 6fd3038405 Improved clarity/readability of internal OpenGL state shadowing functions 2013-04-17 01:06:33 -03:00
Alex Szpakowski 3edf033498 Internally keep track of the value of the current color (issue #564) 2013-04-12 15:24:21 -03:00
Alex Szpakowski 7391d9821f Merged love.graphics.origin into default (issue #124) 2013-04-11 17:59:32 -03:00
Alex Szpakowski c7838b78b6 Added love.graphics.setAlphaTest (issue #534) 2013-04-10 13:17:54 -03:00
Alex Szpakowski c215541d6c Merged mage-CompressedData into default 2013-04-09 23:44:00 -03:00
Alex Szpakowski 1b80853118 Fixed an OpenGL error when MSAA isn't supported 2013-04-09 10:57:43 -03:00
Alex Szpakowski ab2c4aca7e Removed an unused graphics Image method
--HG--
branch : image-CompressedData
2013-04-08 21:58:20 -03:00
Alex Szpakowski 8a8adcce39 Code cleanup
--HG--
branch : image-CompressedData
2013-04-05 18:55:44 -03:00
Alex Szpakowski 5301026f3c Added support for DXT1/3/5 and BC5/7 compressed textures via love.image.CompressedData. Some internals are still iffy.
- added a new CompressedData type to love.image
- added love.image.isCompressed(file or data)
- love.graphics.newImage automatically tests for compression when loading a file
- added love.graphics.isSupported strings for DXT, BC5, and BC7

Compressed textures meant to be used on the GPU offer huge performance gains when
- loading the texture from a file
- loading the texture from RAM to VRAM
- loading mipmaps
- rendering

--HG--
branch : image-CompressedData
2013-04-04 19:09:18 -03:00
Alex Szpakowski d5aa807747 More internal code cleanup 2013-03-31 19:02:27 -03:00