Commit Graph

43 Commits

Author SHA1 Message Date
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
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
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
Bill Meltsner be55579a22 Happy New Year, have an enormous diff 2012-01-09 02:41:11 -06:00
Bart van Strien c78c6801e9 Formatting fix 2012-01-06 17:08:52 +01:00
Bart van Strien f58f80397e Fix fsaa crash on OSX, can't enable multisampling before a window is created (bug #350) 2012-01-06 17:04:48 +01:00
Bart van Strien 7c8fff979a Create love.window, abstract SDL out of love.graphics 2011-12-11 16:55:52 +01:00