Commit Graph

55 Commits

Author SHA1 Message Date
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 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 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 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 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 dac9f4eaaa Added love.window.minimize (resolves issue #904). 2014-07-05 17:55:06 -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 05d8543518 Improved performance of love.graphics.present slightly on some platforms 2014-05-05 16:30:56 -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 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
Alex Szpakowski d70023e350 Enable OpenGL’s debug output when the LOVE_GRAPHICS_DEBUG environment variable is ‘1’. Resolves issue #607. 2014-01-27 23:30:16 -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 f2797958db Don’t minimize on focus loss in fullscreen-desktop mode (mimics post-SDL 2.0.1 behaviour) 2013-11-11 18:07:05 -04:00
Alex Szpakowski 101c6ae90a Fixed love.window.setFullscreen to update the graphics viewport immediately instead of waiting for the next event polling 2013-10-30 14:26:34 -03: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 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 4584cf6780 Always use regular vsync instead of preferring adaptive vsync if supported 2013-08-30 00:33:20 -03:00
Alex Szpakowski 51d3fe22fc Always recreate the GL context in love.window.setMode - SDL_GL_MakeCurrent can return success sometimes in Windows even when the context is trashed 2013-08-28 01:07: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 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 6e3a7288dd Improved performance of ImageData:mapPixel (now up to 2x as fast as in 0.8.0!); love.graphics.newImage, Image:refresh, love.window.setIcon, and ImageRasterizers now prevent other threads from modifying the ImageData used in those functions until they're done accessing it 2013-06-25 05:28:20 -03:00
Alex Szpakowski 1afc47511c Fixed the graphics viewport not matching the window size when an unsupported fullscreen resolution is set 2013-06-08 08:35:16 -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
Alex Szpakowski 9fc2a085cd Updated love.timer.getTime to be microsecond-precise and monotonic (thanks Boolsheet), removed the now-obsolete love.timer.getMicroTime (issue #492) 2013-05-09 23:12:50 -03:00
Alex Szpakowski d5aa807747 More internal code cleanup 2013-03-31 19:02:27 -03:00
Bart van Strien 7efe11b11f Add centered flag to setMode, optionally centers the window (on by default, as before) (issue #463) 2013-03-10 23:00:31 +01:00
Alex Szpakowski 4ae126ac44 Fixed some potential instability or crash issues 2013-03-03 20:23:40 -04:00
Bart van Strien 3d0c5761ce Merge in default, update changelog
--HG--
branch : minor
2013-03-03 19:51:04 +01:00
Alex Szpakowski a68bdfe7a2 Constified many Graphics and Window methods 2013-02-16 01:45:01 -04:00
Alex Szpakowski 96161c66f6 Updated copyright text for the new year 2013-02-05 05:32:49 -04:00
Alex Szpakowski a9211a1389 Removed direct OpenGL calls in the SDL Window module 2013-01-30 00:27:46 -04:00
Bart van Strien f81eebfb5f Reapply sdl's keyrepeat settings after setWindow 2013-01-28 00:25:03 +01:00
Bart van Strien bddee1753b Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Example setMode invocation: love.graphics.setMode(800, 600, {fullscreen = false, vsync = true, borderless = true})
t.screen.resizable and t.screen.borderless are available in love.conf
And love.resize(w, h) gets called if it exists on a resize event.
NOTE: love.handlers.resize(w, h) does the required setMode, but that does mean a visual reload

--HG--
branch : minor
2012-07-23 11:53:13 +02:00
Bart van Strien 7793e7f02f CRLF to LF 2012-07-04 14:40:24 +02:00