Commit Graph

872 Commits

Author SHA1 Message Date
Alex Szpakowski f83c2db471 Cleaned up the Canvas code.
--HG--
branch : minor
2015-02-26 17:06:09 -04:00
Alex Szpakowski a66a7b7ce9 Prevent invalid stencil buffer contents from being used when switching to a Canvas on mobile.
--HG--
branch : minor
2015-02-26 01:00:38 -04:00
Alex Szpakowski e8ce59038f Renamed Canvas:getImageData to Canvas:newImageData (see issue #1001.)
--HG--
branch : minor
2015-02-26 00:13:46 -04:00
Alex Szpakowski 8239d472d4 Removed Canvas:getPixel and added optional x/y/width/height arguments to Canvas:getImageData to specify a sub-rectangle (see issue #1001.)
--HG--
branch : minor
2015-02-25 23:27:35 -04:00
Alex Szpakowski 2cc53bb85c Added Canvas MSAA support in OpenGL ES 2 on iOS and when ANGLE is used on Windows.
--HG--
branch : minor
2015-02-24 03:07:46 -04:00
Alex Szpakowski 517ee44e84 Fixed Canvases on iOS, added support for Canvas MSAA on OpenGL ES 3.
--HG--
branch : minor
2015-02-24 02:36:32 -04:00
Alex Szpakowski aac4b3487a Replace deprecated PHYSFS_addToSearchPath calls with PHYSFS_mount.
--HG--
branch : minor
2015-02-22 17:48:32 -04:00
Alex Szpakowski 1aaa8737ab Merged default into minor
--HG--
branch : minor
2015-02-22 02:38:09 -04:00
Alex Szpakowski 59e1cf23e8 Probably fixed the Windows build 2015-02-22 02:30:26 -04:00
Alex Szpakowski 622b737019 Merged default into minor
--HG--
branch : minor
2015-02-21 03:53:33 -04:00
Alex Szpakowski 971380003b Reorganized some Image code.
--HG--
branch : minor
2015-02-21 03:47:19 -04:00
Alex Szpakowski 813061c0e0 Fix the stencil buffer in Canvases when the graphics driver uses a MSAA value for the Canvas' buffers that's greater than the number of requested MSAA samples.
Fixes https://love2d.org/forums/viewtopic.php?f=4&t=79701
2015-02-21 01:56:17 -04:00
Alex Szpakowski ebc68023a7 Fix many warnings about implicit integer conversions when compiling for 64 bits.
--HG--
branch : minor
2015-02-20 01:20:08 -04:00
Alex Szpakowski e137c9327b Fixed a GL error on startup when OpenGL ES is used.
--HG--
branch : minor
2015-02-18 19:01:19 -04:00
Alex Szpakowski ac2b03e8a4 Added love.graphics.isActive. love.graphics function calls (and method calls on objects created via love.graphics) are only guaranteed to work when isActive is true, otherwise bad things might happen (the program crashing, for example.)
It's usually only false when the app is inactive on iOS, and when the window hasn't been created yet.

--HG--
branch : minor
2015-02-17 02:24:09 -04:00
Bart van Strien 600a369d77 Allow calling newRasterizer without arguments from newFont again
Fixes regression introduced by commit 9b0752574f26, the default value for the
1-argument newFont could not be called.
Thanks to josefnpat for reporting.
2015-02-13 15:18:52 +01:00
Alex Szpakowski 36e99b4880 Fix an OpenGL error when an sRGB image is created with mipmaps in OpenGL ES 2.
--HG--
branch : minor
2015-02-09 21:46:56 -04:00
Alex Szpakowski 2a09774a54 Fixed love.graphics.newFont. 2015-02-02 15:26:13 -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 f6bd177f84 A debug print statement snuck in there... 2015-01-31 01:35:17 -04:00
Alex Szpakowski 9cf1868b81 Fixed the point style and color mask getting reset in love.window.setMode (thanks Shell32) 2015-01-31 01:22:54 -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 6c11443a04 Fixed graphics initialization crashing love when OpenGL ES 2 is used.
--HG--
branch : minor
2015-01-30 04:24:31 -04:00
Alex Szpakowski 54516a5652 Fixed a case of undefined behavior in love.graphics.printf and Text:set.
--HG--
branch : minor
2015-01-29 21:36:28 -04:00
Alex Szpakowski 62d596dec1 Fixed Windows build.
--HG--
branch : minor
2015-01-29 21:28:27 -04:00
Alex Szpakowski ad1fbbf3ea Merged default into minor
--HG--
branch : minor
2015-01-29 21:27:05 -04:00
Alex Szpakowski cf60cf89fc De-namespaced a class, to make it less verbose. 2015-01-24 04:09:56 -04:00
Alex Szpakowski e662fbdf80 Removed some dumb/redundant comments. 2015-01-24 03:52:09 -04:00
Alex Szpakowski 222d4cfdc8 Maybe fixed Windows build? 2015-01-24 03:43:52 -04:00
Alex Szpakowski b876255442 Cleaned up some graphics code. 2015-01-24 03:39:05 -04:00
Alex Szpakowski b4bacb38a6 Fixed love.graphics.getShader() to return nil when no shader is set, fixed a potential (harmless) OpenGL error when OpenGL ES is used.
--HG--
branch : minor
2015-01-24 03:21:33 -04:00
Alex Szpakowski d58505012b Added OpenGL ES support for the 'none' line join mode.
--HG--
branch : minor
2015-01-24 00:05:39 -04:00
Alex Szpakowski 970704c2b7 Added Text objects via love.graphics.newText(font [, textstring]). Reworked the internal code of Font objects to use fewer individual textures and less VRAM per object, and to be compatible with OpenGL ES. Slightly improved the performance of love.graphics.print and love.graphics.printf.
Text objects are Drawable objects that represent text on the screen. They decouple text drawing from text parsing and vertex uploading, in a similar manner to SpriteBatches. They also optionally allow efficient batching of text from the same Font in different relative coordinate transformations, without having many draw calls.

Text objects currently have the following methods:

Text:set(textstring) -- replaces any existing text in the object with the new string.
Text:setf(textstring, wraplimit, alignmode) -- replaces any existing text with formatted text using the new string.

Text:getFont() -- gets the Font object used for this Text object.
Text:getWidth() -- gets the width in pixels of the most recently added text in the Text object.
Text:getHeight() -- gets the height in pixels of the most recently added text in the Text object.

Text:add(textstring, x, y, angle, sx, sy, ox, oy, kx, ky) -- adds a new string to the text object using the specified relative coordinate transformation, without replacing existing text. This behaves much like SpriteBatch:add.
Text:addf(textstring, wraplimit, alignmode, x, y, angle, sx, sy, ox, oy, kx, ky) -- adds a new formatted string to the text object using the specified relative coordinate transformation.
Text:clear() -- clears all text from the object.

--HG--
branch : minor
2015-01-23 00:47:28 -04:00
Alex Szpakowski 27aec48d1a Updated love.graphics.polygon and love.graphics.point to work with OpenGL ES.
--HG--
branch : minor
2015-01-22 18:28:24 -04:00
Alex Szpakowski 5b98083e01 Merged default into minor
--HG--
branch : minor
2015-01-22 02:18:56 -04:00
Alex Szpakowski e71c15e650 Fixed a minor memory leak caused by certain rare error conditions in love.graphics.newCanvas. 2015-01-22 02:16:49 -04:00
Alex Szpakowski 9de0e49b19 Optimized canvas performance when ANGLE is used.
--HG--
branch : minor
2015-01-22 02:12:26 -04:00
Alex Szpakowski 15538426d7 Added support for creating OpenGL ES 2 and 3 contexts, and updated the OpenGL context creation code to be more robust in general.
If the LOVE_GRAPHICS_USE_OPENGLES environment variable is set, then love will try to create an OpenGL ES context before falling back to regular OpenGL. If it's not set (or set to 0), then the opposite happens except when love is run on backends that should always use OpenGL ES.

--HG--
branch : minor
2015-01-22 01:02:01 -04:00
Alex Szpakowski 5c46149afb Properly set shader dirty flags for love_ScreenSize when love.window.setMode is called. 2015-01-21 21:46:33 -04:00
Alex Szpakowski 18569979e9 Better cleanup when the graphics and window subsystems are destroyed and restarted. 2015-01-21 18:23:16 -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 8067d42df2 Canvases now have OpenGL ES support, updated Texture:setWrap to return false for repeat wrap modes in non-power-of-two textures if OpenGL ES 2 is used and the implementation doesn't have support for repeat on NPOT textures.
--HG--
branch : minor
2015-01-20 15:13:59 -04:00
Alex Szpakowski 18ab3973e8 Added support for ETC2/EAC compressed textures. Changed the CompressedFormat enum names to capitalize the format names (e.g. "PVR1rgba4" instead of "pvr1rgba4".) Improved sRGB support for compressed textures.
--HG--
branch : minor
2015-01-20 07:53:44 -04:00
Alex Szpakowski dfdd52e499 Added support for ETC1 and PVR1 compressed textures contained in KTX, PKM, and PVR files.
Most desktop graphics drivers don't support those formats.

--HG--
branch : minor
2015-01-20 03:18:28 -04:00
Alex Szpakowski 3db4e8dea0 Fixed compilation on systems other than my own...
--HG--
branch : minor
2015-01-19 23:32:45 -04:00
Alex Szpakowski 1124612c1f Some work towards OpenGL ES 2+ support for love 0.10.
--HG--
branch : minor
2015-01-19 23:32:16 -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 60eceadc0a Added "mirroredrepeat" wrap mode. 2014-12-22 19:16:36 -04:00