Commit Graph

36 Commits

Author SHA1 Message Date
Alex Szpakowski b0b4613896 I forgot to export love.window.maximize in time for 0.9.2's release. :( 2015-02-14 21:00:30 -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 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 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 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 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 da7cd267ea Changed luax_pushtype to retain the pushed object itself, but only if the object isn't in the Lua state already.
Previously, calling e.g. love.graphics.getFont() 10,000 times would retain the object 10,000 times (and release it 10,000 times when the Font object was garbage-collected in the Lua state.) Now it will only retain it once and release it once.
2014-08-09 16:04:59 -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 dac9f4eaaa Added love.window.minimize (resolves issue #904). 2014-07-05 17:55:06 -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 dfa319e01a Replaced the EXCEPT_GUARD macro for converting love exceptions into Lua errors with the new luax_catchexcept function, which takes lambda function arguments. 2014-06-03 19:27:00 -03: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
Alex Szpakowski 309193895a Added opt-in support for high-dpi mode in OS X when on a retina display (resolves issue #761).
Added a ‘highdpi’ boolean flag to t.window/love.window.setMode (defaults to false.)
When the window is actually in high-dpi mode on a supported display, the graphics width and height and the mouse position are in pixels, rather than ‘window coordinates’.

Added love.window.getPixelScale. Returns the scale factor of the window from user-space points to pixels (e.g. it will be 1 normally, and 2 on a retina display in OS X with high-dpi mode enabled.)
2014-01-17 21:11:20 -04:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -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 b5c231e5bb The window minwidth and minheight can't be less than 1 2013-09-19 23:33:13 -03:00
Alex Szpakowski 0ce0db9e1b The minwidth and minheight window flags have default values of 0 instead of 100 (resolves issue #735).
The real minimum window width and height are still system-dependent.
2013-09-19 19:05:40 -03:00
Alex Szpakowski ffe0485173 Removed love.window.checkMode (resolves issue #653, invalidates issue #592).
Also fixed love.window.setMode to fail instead of bug out when trying to set a fullscreen mode which is too large for the monitor.
2013-09-19 18:13:52 -03:00
Alex Szpakowski 21d1e7737c Fixed ParticleSystem:setAreaSpread("none") to not require x/y arguments (resolves issue #738) 2013-09-17 00:54:55 -03:00
Alex Szpakowski 06f80d5c08 Fixed undefined behaviour when love exceptions are converted into Lua errors (resolves issue #729) 2013-09-05 23:17:29 -03:00
Alex Szpakowski 75340f6c7b Renamed love.window.getModes to love.window.getFullscreenModes (resolves issue #679) 2013-08-29 21:42:05 -03:00
Alex Szpakowski ec9dec6b80 Replaced luax_newtype with luax_pushtype (and added luax_rawnewtype for the old functionality of luax_newtype.)
luax_pushtype keeps the object in a weak table and checks the table before creating a new userdata, so it re-uses the object's existing wrapper userdata if it can, whenever the object is pushed to Lua.

This fixes some subtle issues with love objects, where using them as keys in tables would not always work as expected (https://love2d.org/forums/viewtopic.php?f=4&t=39398&p=112388#p112415). It also decreases the amount of new Lua objects created, saving the garbage collector some work.
2013-08-29 00:40:06 -03:00
Alex Szpakowski 526ccb12ad Renamed love.window.isFullscreen to love.window.getFullscreen (resolves issue #721) 2013-08-28 19:15:00 -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 035130533b Updated love.window.checkMode to work when a windowflag table is used as the third parameter 2013-08-22 20:28:50 -03:00
Alex Szpakowski 76565a3e11 Renamed love.window.setCaption to love.window.setTitle (resolves issue #703) 2013-08-14 11:16:41 -03:00
Alex Szpakowski 3e57cfd174 Slightly reduced internal reliance on specific module backends 2013-08-03 16:30:37 -03:00
Alex Szpakowski 7601ef05f4 Fixed a potential memory leak 2013-07-12 15:18:27 -03:00
Bart van Strien 25d0d87247 Add love.window.getIcon, and reset it after setMode, so it doesn't get reset (issue #667 and issue #513) 2013-07-09 15:19:49 +02:00
Alex Szpakowski eaf69aead1 Renamed love.window.setTitle back to love.window.setCaption
Previous rename was unnecessary
2013-05-21 22:24:51 -03:00
Alex Szpakowski 2b54ea23de Added love.window.isVisible 2013-05-20 06:25:51 -03:00
Alex Szpakowski b391a9f4a6 Added love.window.hasMouseFocus (issue #120) 2013-05-11 15:57:16 -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