Commit Graph

55 Commits

Author SHA1 Message Date
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 0a36c41ba0 Removed support for BC7-compressed DDS images (only *very* modern systems support it right now); updated the ddsparse library 2013-06-09 16:31:02 -03:00
vrld e9d0204cdc Disallow concave shapes as geometry. 2013-05-12 13:01:05 +02: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 3b05ec0635 Geometries now automatically use per-vertex colors when drawing if any vertex has a custom color set, otherwise the constant color is used.
Still not a perfect solution, but it works better than before
2013-04-23 23:25:45 -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 6fd3038405 Improved clarity/readability of internal OpenGL state shadowing functions 2013-04-17 01:06:33 -03:00
Alex Szpakowski b22f1aa16a Added Image:refresh(), reloads a love.graphics image using the imagedata that created it 2013-04-10 00:15: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 299ee64320 Added Image:isCompressed()
--HG--
branch : image-CompressedData
2013-04-07 23:11:11 -03:00
Alex Szpakowski 88d64954a4 Replaced the devil love.image module with love.image.magpie, which can decide which image library to use in a similar manner to love.sound.lullaby. Some rough edges still exist.
love.filesystem.newFileData now accepts filepaths and File objects.

--HG--
branch : image-CompressedData
2013-04-07 17:18:34 -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 2009124cf9 Reworked internal anisotropic filtering code to be more concise and intuitive 2013-03-21 12:21:13 -03:00
Alex Szpakowski 25d6700361 Moved anisotropic filtering to Image:setFilter(min, mag, anisotropy), added anisotropic filtering support to canvases and fonts 2013-03-20 23:23:26 -03:00
Alex Szpakowski 8c406b7a4b Added anisotropic filtering functionality for images, consolidated mipmap methods into Image:setMipmapFilter(filtermode, sharpness, anisotropy), added love.graphics.setDefaultMipmapFilter(filtermode, sharpness, anisotropy) 2013-03-19 22:42:12 -03:00
Alex Szpakowski 86ced3c70e Simplified the error message on image creation failure 2013-02-24 15:02:56 -04:00
Alex Szpakowski 7d579308dc LÖVE now errors when Image creation fails 2013-02-24 00:50:39 -04:00
Alex Szpakowski 472915a4bb Worked around ATI/AMD driver bugs when creating mipmaps for Images 2013-02-23 15:52:03 -04:00
Alex Szpakowski 23968d3b4a Fixed image mipmap creation on some systems with buggy video drivers 2013-02-17 11:36:17 -04:00
Alex Szpakowski 96161c66f6 Updated copyright text for the new year 2013-02-05 05:32:49 -04:00
rude de8b4d91a5 Use GLint when getting GL_GENERATE_MIPMAP.
Using GLboolean caused a stack corruption according to VS2012.
2013-01-12 12:53:07 +01:00
Bart van Strien b97765b169 Check for OpenGL 2.0 in NPOT check (issue #538) 2013-01-18 00:29:01 +01:00
Alexander Szpakowski eb98e8cc48 Removed unnecessary tabs in empty lines, fixed texture filtering when the minification and mipmap filter are the same 2013-01-07 06:56:59 -04:00
Alexander Szpakowski 8b3fb1d71c Code cleanup 2013-01-02 17:19:41 -04:00
Alexander Szpakowski 2d077758d1 Fixed mipmap generation for pre-FBO systems, fixed NPOT check if mipmap filtering is enabled on an image before the texture is created 2013-01-02 05:29:17 -04:00
Alexander Szpakowski f067e228b4 Fixed mipmap sharpness setting not being correctly reapplied on resolution change 2013-01-02 04:44:24 -04:00
Alexander Szpakowski fda16e27cd Changed image mipmap api: Image:setFilter now takes an optional third argument (mipmap filter mode), Image:get/setMipmapFilter is removed. 2013-01-02 04:21:22 -04:00
Alexander Szpakowski 2739ea561a Initial image mipmapping implementation. Includes Image:set/getMipmapFilter and Image:set/getMipmapSharpness. setMipMapFilter requires a filter mode, or nil to disable mipmapping.
Enabling mipmapping on an image that does not have power-of-two dimensions will raise an error, due to inconsistent support in older graphics chipsets
2013-01-02 02:50:13 -04:00
Alexander Szpakowski 1678252b7a Applied patch from issue #542 (texture filtering inconsistencies) in main LÖVE repository 2013-01-01 21:29:38 -04:00
Bart van Strien 7793e7f02f CRLF to LF 2012-07-04 14:40:24 +02:00
rude 81c38e22d0 Applied the new style guidelines.
Well, sort of. Lot's more to be done, but this is a start.
2012-06-28 23:52:33 +02:00
Bart van Strien 1e00f0f981 Move the default image filter to the Image class, instead of Graphics applying it on newImage 2012-05-18 17:35:51 +02:00
Bart van Strien 2ac4a9e6d0 Manually keep track of bound textures, so we don't have to poll each frame
Patch submitted by slime73.
2012-01-10 15:36:18 +01:00
Bill Meltsner be55579a22 Happy New Year, have an enormous diff 2012-01-09 02:41:11 -06:00
Bart van Strien 870973197c Only bind images when they weren't (issue #353) 2012-01-07 11:37:50 +01:00
Bart van Strien 864c800e10 Fix some warnings 2011-12-27 21:25:06 +01:00
Bart van Strien 0aae9684b3 Automated formatting fix 2011-11-16 11:32:41 +01:00
Bart van Strien d8b1d67a34 Centralize NPOT support check for image, export it to isSupported 2011-10-24 17:43:56 +02:00
vrld ce9e694acc Make setDefaultImageFilter() not break image:setFilter() (thanks adrix89!) 2011-10-10 12:16:28 +02:00
vrld 48137cd2e1 Fix Issue #278: Set default filter mode for new images.
Add the somewhat lengthy named love.graphics.getDefaultImageFilter() and
love.graphics.getDefaultImageFilter(). The verbose name should point to the
fact that changing the default filter midway through the game will not affect
the images already loaded using love.graphics.newImage().
2011-10-07 14:44:17 +02:00
Bill Meltsner 14348f6146 Create DrawQable class, make Image and Canvas DrawQable, and make love.graphics.drawq take a DrawQable as its first argument 2011-10-04 12:33:34 -04:00
vrld d420d68048 Add shear transformation and transform object (issue #152).
Add origin parameters to love.graphics.print.

New shear parameters kx,ky for:
- love.graphics.draw,
- love.graphics.drawq,
- love.graphics.print,
- SpriteBatch:add,
- SpriteBatch:addq.

Transform objects apply to:
- love.graphics.draw,
- love.graphics.drawq,
- love.graphics.print.
2011-07-05 14:33:34 +02:00
Bart van Strien d613505a77 Only pad when needed 2011-06-10 15:03:27 +02:00
Bart van Strien 87fd3362e2 Mixed up s and t, po2ify should work correctly now, quads still broken 2011-05-16 17:02:43 +02:00
Bart van Strien 360c190ef7 Move po2ifying to Image, Quads broken at the moment 2011-05-15 23:31:12 +02:00
Bill Meltsner fde708160e bringing in the new year by changing every 2010 to 2011 2011-01-15 14:40:27 -06:00
rude 1eca14ed9e Fixed artifacts exposed (not really caused) by a0d18b527fb1. GL_CLAMP is deprecated in OpenGL ES. Image::Filter and Image::Wrap did not have reasonable default. 2010-09-14 20:41:14 +02:00
Bart van Strien 29c68d06f1 Image settings now survive setMode, fixes bug #10 2010-08-04 13:38:22 +02:00
Bill Meltsner e661459103 Switched Image filter modes to use the new string constant system 2010-02-09 14:30:41 -05:00