Commit Graph

53 Commits

Author SHA1 Message Date
Alex Szpakowski fda005c5ff love.graphics.getScissor now has a proper C++ module method 2014-01-09 22:49:00 -04:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -04:00
Alex Szpakowski 44d87212b7 Fixed Joystick:isDown to accept 1-based instead of 0-based button indices 2013-12-23 00:28:03 -04:00
Alex Szpakowski 71dd15838e Workaround for SDL_HAPTIC_INFINITY failing in Windows is no longer needed (patched in SDL as of 2 months ago) 2013-12-17 04:03:04 -04:00
Alex Szpakowski 25caa188ba Fixed Joystick:getName to be more consistent 2013-10-05 04:07:39 -03:00
Alex Szpakowski 8b7f151a4d Added joystick vibration support for most common controllers (resolves issue #159).
Added Joystick:setVibration(left, right), Joystick:getVibration, and Joystick:isVibrationSupported.
left and right are numbers between 0 and 1 which correspond to the strength of the gamepad's left and right rumble motors, if it has them.
2013-10-05 01:54:41 -03:00
Alex Szpakowski 95eedcd1be Using auto for some iterators for less dense-looking code 2013-09-30 02:35:10 -03:00
Alex Szpakowski d9cd10e29c love.joystick now scans for connected joysticks when the module is initialized instead of only relying on joystick add events 2013-09-16 02:42:50 -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 3ac0710544 Renamed Joystick:getProductGUID back to Joystick:getGUID 2013-08-30 23:50:29 -03:00
Alex Szpakowski deba2926ce Prefer the Joystick name rather than the GameController name for Joystick:getName 2013-08-29 01:39:21 -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 3f6b280d54 Joystick:getID now returns the Joystick's instance id as a second argument, if the Joystick is connected.
The Joystick gets a new unique instance id every time it's connected.
2013-08-28 05:23:02 -03:00
Alex Szpakowski 4fcf47a427 Renamed Joystick:getGUID to Joystick:getProductGUID for greater clarity 2013-08-28 04:21:08 -03:00
Alex Szpakowski 390a47099e Removed some dead/useless joystick code 2013-08-26 18:18:07 -03:00
Alex Szpakowski 6ade6225df Replaced love.joystick.getJoystick with love.joystick.getJoysticks (returns a table of all connected joysticks), and renamed Joystick:getIndex to Joystick:getConnectedIndex 2013-08-26 17:37:59 -03:00
Alex Szpakowski 75eb34379c Changed Joystick:getID to be 1-based instead of 0-based 2013-08-26 17:35:10 -03:00
Alex Szpakowski db1e8e762a Joystick:getIndex now returns nil instead of -1 if the joystick isn't connected 2013-08-26 13:27:19 -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 3b3c5c3711 Removed love.joystick.getBall and love.joystick.getBallCount (issue #648) 2013-06-30 16:59:28 -03:00
Alex Szpakowski 63404f7097 Added love.graphics.getRendererInfo(infotype). Useful for creating more informative error reports and advanced debugging.
Returned string can be highly system-dependent, so don't rely on its output!

infotype can be "name", "version", "vendor", or "device"
2013-05-05 16:47:42 -03:00
Alex Szpakowski 4c616e409b Renamed ParticleSystem:count, Channel:count, and all getNum* functions to get*Count (issue #602) 2013-05-03 04:04:44 -03:00
Alex Szpakowski 4ae126ac44 Fixed some potential instability or crash issues 2013-03-03 20:23:40 -04:00
Alex Szpakowski 96161c66f6 Updated copyright text for the new year 2013-02-05 05:32:49 -04: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
Bart van Strien 8211b8f93f Add love.joystick.reload, remove love.joystick.open and friends. (issue #392)
Reload originates from love-experiments, as noted in the ticket.
2012-05-18 19:42:46 +02:00
Bart van Strien 07bd386d4e Apply the 1-indexed joysticks patch from issue #391.
Submitted by: Alexander Szpakowski
2012-03-10 14:11:20 +01:00
Bill Meltsner be55579a22 Happy New Year, have an enormous diff 2012-01-09 02:41:11 -06:00
Bart van Strien c707a4ca45 Properly export all lua-facing functions and use those for initialization (love.cpp no longer explicitly mentions implementations) 2011-12-24 01:10:40 +01:00
Bart van Strien 0aae9684b3 Automated formatting fix 2011-11-16 11:32:41 +01:00
Bart van Strien 4fd9888a16 Merge in minor branch, now minor is our next development target 2011-05-07 14:12:41 +02:00
Bart van Strien bf9ad64559 Prevent negative joystick button indices from being used by isDown. (as mentioned in issue #121) 2011-04-23 19:12:52 +02:00
Bart van Strien cdf85280b6 Fix 2 compiler warnings 2011-04-08 09:12:30 +02:00
Bart van Strien 529530c198 love.joystick.isDown gets multiple arguments too 2011-04-07 19:06:36 +02:00
rude 3fe9b2ff16 Reverted module selection feature. This is not really desired.
Users (or lovers) do not get to choose which implementation of
a module they would like to use.

The abstraction is for dealing with portability issues, not
for giving people the ability to choose an alternative
(inferior) backend. The best choice for any platform/situation
should at all times be the *default* for that platform/situation.
If this is not the case; it's a bug (that is easily fixed).

Any module should provide the functionality promised in the docs.
The lover (or user) should not care how, and if [s]he does, [s]he
does still not get to choose.

Also, a related note: duplication of wrapper code is something I
especially wanted to avoid when I first (or should I say ...
"eventually") formed the current architecture.

--HG--
branch : minor
2011-03-26 17:06:05 +01:00
Bart van Strien b4139ffab5 Rename loaders to fit their locations
--HG--
branch : minor
2011-03-13 20:25:35 +01:00
Bart van Strien f7bcb3e146 Revert that last commit, the wrappers already handle the offset
--HG--
branch : minor
2011-01-17 11:22:59 +01:00
Bart van Strien df50a6e4c5 Handle invalid index in love.joystick, but then 1-indexed (bug #172)
--HG--
branch : minor
2011-01-17 11:10:46 +01:00
Bart van Strien 677df8d4f0 Merge 'default' into 'minor'
--HG--
branch : minor
2011-01-17 11:08:58 +01:00
Bart van Strien 98406370eb Gracefully handle negative indexes in love.joystick (bug #172) 2011-01-17 11:04:02 +01:00
Bill Meltsner fde708160e bringing in the new year by changing every 2010 to 2011 2011-01-15 14:40:27 -06:00
Bart van Strien 675e91dbc8 Make love.joystick 1-indexed
--HG--
branch : minor
2011-01-04 01:09:32 +01:00
bart@bartbes.ath.cx 736f7ab1a2 love.thread can now share full userdata 2010-02-14 17:41:11 +01:00
rude aa01c984b9 Updated all dates to 2010. 2010-01-31 16:54:47 +01:00
rude 87e3c4131c Finally abstracted constants properly. Changed how the event module works; wasn't really abstract before. Removed libs we're not going to use: native, signal. 2009-10-10 11:11:04 +02:00
rude 623e701549 Modules now reside in Lua and are treated (almost) like normal objects.
Also added a way of getting a pointer to abstract module instances internally.
2009-09-02 21:18:13 +02:00
rude dd420d68a3 Ok, project generation didn't really work out. Reverted. 2009-08-10 21:33:07 +02:00
rude ba1a75e547 Added many comments, and changed function names for wrapper functions. 2009-08-09 21:08:55 +02:00
rude 8e681b4204 It's now possible to build each module individually (as a DLL). 2009-08-04 19:57:14 +02:00