Commit Graph

99 Commits

Author SHA1 Message Date
Alex Szpakowski 66942d5f31 Added the ability to use custom mipmaps in Images, via love.graphics.newImage(filename, {mipmap1, mipmap2, ...}). Resolves issue #1064.
All mipmap levels must be present if custom mipmaps are used (and their sizes must be half the size of the previous mipmap level, rounded down.)

Image:getData now returns all custom mipmaps in an Image.
2015-07-30 20:48:36 -03:00
Alex Szpakowski 8bf8c0cd18 Hopefully work around an issue where older Intel drivers on Windows use Microsoft's OpenGL 1.1 software renderer instead of failing to create the context, when a requested framebuffer attribute value is unsupported.
Failing to create the context is preferred in that situation because love's code will then try disabling various framebuffer settings to get a hardware-accelerated context using a supported OpenGL version.
2015-07-28 11:27:45 -03:00
Alex Szpakowski f5abedaeeb Cleaned up the love.graphics code that deals with love.window to be more consistent with the rest of the codebase. 2015-07-24 21:40:55 -03:00
Alex Szpakowski 4cd725cee6 Added love.window.close (resolves issue #1059), and renamed love.window.isCreated to love.window.isOpen. 2015-07-18 13:22:55 -03:00
Alex Szpakowski b2b5a1d9df Fixed a compiler warning on Linux and iOS. 2015-06-09 21:26:41 -03:00
Alex Szpakowski 91e2227124 Fixed the behaviour of love.window.requestAttention on Windows. 2015-06-07 20:19:42 -03:00
Alex Szpakowski cf73aa0107 Added love.window.requestAttention. Bounces the dock icon in OS X and flashes the taskbar icon in Windows when called, if the program isn't in focus. 2015-06-07 19:40:46 -03:00
Alex Szpakowski a9e4be760e Updated the list of SDL backends which should default to OpenGL ES to include emscripten. 2015-06-02 23:06:31 -03:00
Alex Szpakowski 0f986b10aa Cleaned up some code, the 'ry' parameter of love.graphics.rectangle now defaults to the value of 'rx' rather than defaulting to 0. 2015-05-27 17:36:27 -03:00
Alex Szpakowski 3704595189 Enabled OpenGL ES 3 support for Windows/Linux/Android when SDL 2.0.4+ is used, since that SDL version fixed its EGL code for GLES 3+. 2015-05-11 21:14:10 -03:00
Alex Szpakowski cf0968fc6d Avoid some VC++ compiler warnings 2015-04-02 00:28:09 -03:00
Alex Szpakowski cffa899e03 Explicitly mention SDL in the error message caused by SDL subsystem initialization failure. 2015-03-26 14:51:47 -03:00
Alex Szpakowski 14cbc91e7f Fixed a memory leak in love.graphics.newText. 2015-03-16 03:13:10 -03:00
Alex Szpakowski 06fa7bd7a4 Don't enable SDL_GL_FRAMEBUFFER_SRGB_CAPABLE in Linux when creating the window, to work around a potential bug. sRGB windows are still possible even without that. 2015-03-03 17:48:19 -04:00
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