Commit Graph

85 Commits

Author SHA1 Message Date
Alex Szpakowski 52c4f2c119 Improved the performance of love.window.getPixelScale / toPixels / fromPixels by caching some values. Made some coordinate space-sensitive code use the proper conversions to get to the correct coordinate space.
--HG--
branch : minor
2015-02-23 17:55:30 -04:00
Alex Szpakowski e26e170f78 Enabled high-dpi code on Linux (even though SDL doesn't support it yet on Linux, as of 2.0.4.) SDL 2.0.1 or newer is now required on Linux.
I'd rather have high-dpi work on Linux without needing to rebuild love when it's eventually implemented in SDL, rather than preserve backwards-compatibility with SDL 2.0.0 on Linux (which isn't important for love 0.10.0.)

--HG--
branch : minor
2015-02-21 19:06:41 -04:00
Alex Szpakowski bf8f6f8b02 Changed the default fullscreen type from 'exclusive' to 'desktop'.
--HG--
branch : minor
2015-02-21 17:27:54 -04:00
Alex Szpakowski 33f57ce8fd OpenGL ES 3 contexts can only be reliably created on iOS (for now.)
--HG--
branch : minor
2015-02-21 17:16:40 -04:00
Alex Szpakowski 7f9abc1e77 Added love.touch module and touch screen events. Resolves issue #825.
Note: this implementation is slightly different from the implementation in the love 0.9.x Android and iOS ports!

Added love.touchpressed(id, x, y), love.touchmoved(id, x, y, dx, dy), and love.touchreleased(id, x, y, dx, dy).

id is a unique identifier for the touch press that persists until love.touchreleased. After that it is no longer unique.
x and y are the coordinates of the touch event in pixels within the window.
dx and dy are the amount in pixels that the touch has moved since the last event.

Added love.touch.getTouchCount and love.touch.getTouch(index).

love.touch.getTouch takes an index (not the same as an id. indices are not stable and don't correspond to a unique touch press.)
It returns the id of the touch and its current x and y coordinates in pixels.

--HG--
branch : minor
2015-02-16 16:29:45 -04:00
Alex Szpakowski d0e34e86f1 Changed love.window.setMode to recreate the window as well as the context if a particular context profile can't be created, to work around some limitations of the OpenGL context and window code in some SDL backends.
The window/context creation code might still need some work..

--HG--
branch : minor
2015-01-30 17:19:47 -04:00
Alex Szpakowski 84a6dd3b1c Fixed OpenGL context version checking when OpenGL ES is used.
--HG--
branch : minor
2015-01-30 04:48:09 -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 cc79089339 Fixed a crash in love.window.setMode in Windows.
--HG--
branch : minor
2015-01-30 01:28:27 -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 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 18569979e9 Better cleanup when the graphics and window subsystems are destroyed and restarted. 2015-01-21 18:23:16 -04:00
Alex Szpakowski a7e4148869 Merged default into minor
--HG--
branch : minor
2015-01-16 15:47:26 -04:00
Alex Szpakowski be9b5b5d1a Added love.window.maximize (resolves issue #966.) 2015-01-05 00:00:46 -04:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04:00
Alex Szpakowski 34688e929e Merged default into minor
--HG--
branch : minor
2014-09-28 15:56:04 -03:00
Alex Szpakowski d3e1993673 Rearranged love.window.showMessageBox' arguments so the messagebox type is the second-last argument and defaults to "info" (resolves issue #937.) 2014-09-28 15:37:56 -03:00
Alex Szpakowski c6b610d116 Cleaned up some code. 2014-09-21 19:50:02 -03:00
Alex Szpakowski aba33bf2e7 Merged default into minor
--HG--
branch : minor
2014-09-20 00:34:34 -03:00
Alex Szpakowski d4c60e077d Fixed the window position in fullscreen modes. 2014-09-19 17:24:30 -03:00
Alex Szpakowski b75e1bdeaa Added love.window.setPosition(x, y [, displayindex]), love.window.getPosition, and optional x and y fields for t.window in love.conf and for the flags table in love.window.set/getMode (resolves issue #930.) 2014-09-19 16:19:55 -03:00
Alex Szpakowski cf7342f8b7 Use C++11's in-line member initializers instead of default constructors with initializer lists, for some structs.
--HG--
branch : minor
2014-09-18 02:39:18 -03:00
Alex Szpakowski fffbd3ecab Merged default into minor
--HG--
branch : minor
2014-09-18 02:15:20 -03:00
Alex Szpakowski 00944c5f5d Added love.window.toPixels(x [, y]) and love.window.fromPixels(x [, y]), for easier conversion between window-space and pixel-space values when highdpi mode is enabled on a retina display in OS X (and in the iOS and Android ports of LÖVE.) 2014-09-14 15:58:37 -03:00
Alex Szpakowski 71c71985d3 Merged default into minor
--HG--
branch : minor
2014-08-21 16:53:43 -03:00
Alex Szpakowski e1f7e4abd3 Added a 'refreshrate' field to the table returned by love.window.getMode. The value may be 0 if the refresh rate of the monitor can't be determined. It might also be 59 instead of 60 on 59.94hz monitors on some operating systems. 2014-08-20 20:22:46 -03:00
Alex Szpakowski 53e63d48c9 Merged default into minor
--HG--
branch : minor
2014-08-07 18:10:19 -03:00
Alex Szpakowski d59c76a55f Reduced the number of explicit retain/release method calls on love objects. Less chance of bugs! 2014-08-07 14:53:17 -03:00
Alex Szpakowski 2c7ee6959e Renamed the fullscreen type "normal" to "exclusive".
--HG--
branch : minor
2014-07-30 01:38:45 -03:00
Alex Szpakowski aa05664d4c Merged default into minor
--HG--
branch : minor
2014-07-30 01:32:10 -03:00
Alex Szpakowski eaad102f5c Calling love.window.setMode with fullscreen=true and a width or height larger than the largest fullscreen mode now falls back to the largest fullscreen mode instead of failing and returning false. 2014-07-30 01:22:01 -03:00
Alex Szpakowski 3ae336dd43 Added love.window.showMessageBox.
It has two variants: showMessageBox(type, title, message [, attachtowindow=true]), and showMessageBox(type, title, message, buttons [, attachtowindow=true]). The former shows a simple message box with a single OK button, and the latter displays several buttons. The buttons argument is an array of button names.

The second variant returns the index of the pressed button, or 0 if the message box was closed some other way. showMessageBox will block until the message box is closed (and it can't be called on a separate thread.)
2014-07-21 21:28:21 -03:00
Alex Szpakowski 014b9a46e5 Updated the Lua wrapper code for modules to account for cases where the module's instance is removed from memory completely and recreated during the program's lifetime. 2014-07-21 14:52:01 -03:00
Alex Szpakowski e3f9c0dca4 Merged default into minor
--HG--
branch : minor
2014-07-08 14:01:55 -03:00
Alex Szpakowski dac9f4eaaa Added love.window.minimize (resolves issue #904). 2014-07-05 17:55:06 -03:00
Alex Szpakowski 2bfa8dbfb5 Merged default into minor
--HG--
branch : minor
2014-06-16 03:09:04 -03:00
Alex Szpakowski d2450d5f2e Updated changelog for changes which aren't in the minor branch 2014-06-14 16:58:24 -03:00
Alex Szpakowski aa882cbcbc Added love.window.getDisplayName, to get the name of a connected display. 2014-06-14 16:20:30 -03:00
Alex Szpakowski 23d3cbc2e2 Renamed all cases of FSAA to the more accurately-named MSAA. The FSAA names (canvas:getFSAA, t.window.fsaa, etc.) still exist for now, for backwards-compatibility. 2014-06-13 23:28:00 -03:00
Alex Szpakowski 53b20b63a5 Merged default into minor
--HG--
branch : minor
2014-05-21 21:16:37 -03:00
Alex Szpakowski 05d8543518 Improved performance of love.graphics.present slightly on some platforms 2014-05-05 16:30:56 -03:00
Alex Szpakowski 3abb1a2cbb Removed love.window.getWidth/getHeight. Use love.graphics.getWidth/getHeight or love.window.getMode instead.
love.window.getWidth/getHeight were originally added to help deal with high-dpi mode, but the API ended up going in a different direction (love.window.getPixelScale).

--HG--
branch : minor
2014-04-05 01:40:30 -03:00
Alex Szpakowski 6dc10cfd15 Merged default into minor
--HG--
branch : minor
2014-04-01 20:46:31 -03:00
Alex Szpakowski c985b1f2f7 Don't destroy OpenGL resources before checking whether the fullscreen size is supported in love.window.setMode. 2014-03-31 05:01:29 -03:00
Alex Szpakowski a22c4b5f92 Explicitly #ifdef'd out SDL 2.0.1+ function calls for Linux to avoid runtime function resolving problems when love is built with SDL 2.0.1+ headers but run using SDL 2.0.0. 2014-03-31 03:45:22 -03:00
Alex Szpakowski caa61563cc OpenGL 2.1 is now required to use love.graphics (resolves issue #779.)
Removed love.graphics.isSupported("canvas", "shader", "npot", "subtractive", and "mipmap"), since those features are all guaranteed by the minimum system requirements.

--HG--
branch : minor
2014-03-12 02:26:32 -03:00
Alex Szpakowski f7c0fc1888 Make sure love.window.getMode returns up-to-date information about the window, remove some Mac-specific windowing code now unnecessary with SDL 2.0.2. 2014-03-03 03:36:17 -04:00
Alex Szpakowski 823b1babc8 Specifying the srgb window flag should now cause it to fall back to srgb=false in all situations if an srgb-capable system framebuffer isn't supported, instead of failing to create the window 2014-02-04 02:02:54 -04:00
Alex Szpakowski ce4fdf4ac9 Added sRGB (gamma-correct) support for Images, Canvases, and the main screen.
love.graphics.newImage(path, “srgb”) creates a new Image whose texels are treated as being in the sRGB color space, so they are linearized when drawing/sampling from the image.

love.graphics.newCanvas(w, h, “srgb”) creates a new Canvas whose texels are treated as being in the sRGB color space, so drawing to the Canvas does a linear->sRGB conversion (but blends linearly), and sampling from it (drawing it or using it in a shader) converts from sRGB to linear space.

The "srgb" window flag does the same as Canvases for the main screen.
2014-02-02 18:31:41 -04:00