Commit Graph

258 Commits

Author SHA1 Message Date
Alex Szpakowski 604bc34106 Hopefully fixed the default filesystem identity when a game is fused to the executable in Windows. 2014-09-16 14:24:04 -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 c502847802 Enable strict mode for shaders on some nvidia drivers. Should hopefully prevent some issues where nvidia GLSL compilers let things slide that should be illegal. 2014-08-31 00:51:54 -03:00
Alex Szpakowski ab9954272a Updated the initialization code to trigger a real Lua error if love.conf has an error in it. 2014-08-28 20:39:49 -03:00
Alex Szpakowski 1449a81bdf Removed some dead code. 2014-08-26 22:16:01 -03:00
Alex Szpakowski 234ee0fea6 Fixed the default error handler's background color when sRGB is enabled for the screen. 2014-08-22 17:58:07 -03:00
Alex Szpakowski a658c7df76 Fixed the error screen when highdpi mode is enabled on a retina monitor in OS X (resolves issue #908) 2014-07-12 21:12:21 -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 3792dee4b4 Backout changeset 57172a7f03452a6b07f346e850f3e1020e230f46 2014-06-05 14:59:29 -03:00
Alex Szpakowski e9e303c1e8 Changed embedded Lua scripts to be included in the love source via C++11's raw string literals instead of a generated header file. Removed auto.lua.
As a result, love can be compiled immediately after editing an embedded Lua script.

Visual Studio 2013 or newer is required for C++11 raw string literals in Windows.
2014-06-05 13:42:03 -03:00
Alex Szpakowski 4d0bbb97d8 Fixed Lua pattern matching for detecting the 'position' and 'effect' shader functions (thanks lpghatguy!) 2014-05-31 00:42:18 -03:00
Alex Szpakowski fd5b5aad65 Minor code cleanup 2014-05-21 21:14:08 -03:00
Alex Szpakowski 0372977dfa Backout changeset 6dd72101871f163ee0e644c751f80773d45f339f
The change should only be done for GLES, not desktop GL - their specifications differ on this.
2014-05-03 22:21:45 -03:00
Alex Szpakowski 5428a5d75f Backout changeset b3928e24add23da69dcd90c34985cd6a05454be0 2014-05-03 22:07:32 -03:00
Alex Szpakowski 4bc96f1bf6 Internally compose and pass an array of shader source codes to OpenGL, instead of relying on #line to make sure the line number is correct for shader error messages (resolves issue #882) 2014-05-03 21:43:20 -03:00
Bart van Strien 9972153696 Use '#line 1' instead of '#line 0' in shader sources, for compatibility with GLES (fixes #882) 2014-05-03 14:50:08 +02:00
Alex Szpakowski 4ea18d8bbc love.math.setRandomSeed now calls random() a couple times internally, to make similar seeds give less similar results when random() is called for the first time after setRandomSeed. 2014-04-05 18:55:05 -03:00
Alex Szpakowski 9dd3f70988 Use love.filesystem.isFile instead of love.filesystem.exists when checking for main.lua and conf.lua on startup 2014-04-02 22:16:27 -03:00
Alex Szpakowski f65e9826d9 Disabled shader code for instancing 2014-03-29 17:51:33 -03:00
Alex Szpakowski fc77e8f9f0 Throw away the first 3 love.math.random results after seeding it (xorshift outputs less random results the first few times when the seed is very similar to a previous one) 2014-03-15 21:43:25 -03:00
Alex Szpakowski 4faddcd9aa Fixed some trivial compiler warnings 2014-03-12 17:55:19 -03:00
Alex Szpakowski ec0f428c4f Cleaned up the code for initializing love.filesystem and the source and save directories a bit 2014-03-01 20:23:04 -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 007d0d5216 Windows: create the console before modules are loaded (allows information printed during module initialization to be displayed.) 2014-01-29 16:20:05 -04:00
Alex Szpakowski c5c788e976 Added a built-in variable readable in shaders: ‘love_ScreenSize’. Its x and y components contain the width and height of the current viewport. Resolves issue #841. 2014-01-27 02:58:34 -04:00
Alex Szpakowski 73f1ce0d40 Added instancing support to Meshes via Mesh:setInstanceCount. Added a new built-in variable to vertex shaders: int love_InstanceID.
love.graphics.draw(mesh) will draw the mesh instancecount times, using hardware instancing when available. The only way to draw individual instances differently from each other is to use the love_InstanceID variable in a vertex shader.

Added love.graphics.isSupported(“instancing”). Hardware instancing is supported if true, otherwise a (slower) pseudo-instancing fallback is used internally when drawing instanced meshes.
2014-01-21 06:01:50 -04:00
Alex Szpakowski 81d9810ed8 Fixed t.window.highdpi in love.conf, updated the nogame screen to look slightly better on retina displays 2014-01-18 00:41:02 -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 aa69a695d3 Canvases can now be used in SpriteBatches, ParticleSystems, and Meshes (resolves issue #782).
Canvases and Images are now subclasses of the new Texture class.
Added setTexture and getTexture methods for Meshes, ParticleSystems, and SpriteBatches (the old set/getImage methods are deprecated but not removed.)
Canvas texture coordinates are no longer flipped.
2014-01-03 17:07:12 -04:00
Bart van Strien d81eae8889 Scripts now automatically recompile on change on linux, auto.lua normalizes input names a bit more 2013-12-14 13:57:52 +01:00
Alex Szpakowski eadb718ade Fused status is now set before conf.lua is loaded 2013-12-07 02:13:54 -04:00
Alex Szpakowski f997cc43c1 Fixed a crashing issue when the error handler can’t create a window 2013-12-04 17:03:34 -04:00
Bart van Strien 33bb049ee6 Don't call love.graphics functions in love.run until a window has been created, prevents segfaults when love.window and love.graphics were loaded, but there was no window 2013-12-02 21:07:43 +01:00
Alex Szpakowski 1c8abc74aa Renamed love.math.g/setRandomState and rng:g/setState to love.math.g/setRandomSeed and rng:g/setSeed.
getRandomSeed now always returns the previously set random seed instead of the current (implementation-dependent) random state.
2013-12-01 21:25:27 -04:00
Alex Szpakowski 0fb05fd84d Reorganized the nogame screen’s drawing code to marginally reduce CPU usage. Woo! 2013-11-13 04:07:29 -04:00
Bart van Strien b8a69ab2b6 At least decode file uris now 2013-11-03 20:23:31 +01:00
Alex Szpakowski 8cc5364d15 Changed the SearchOrder argument of love.filesystem.setIdentity and love.filesystem.mount to a boolean (append) instead of an enum 2013-10-30 17:05:46 -03: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
Bart van Strien f846ed60b2 Old merge? 2013-10-15 20:03:58 +02: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
Bart van Strien 6aa150fe8b Add t.window.icon to love.conf (resolves #668) 2013-10-04 14:36:29 +02:00
Bart van Strien 3ba22cad7b Seed love.math's random, instead of lua's in love.run (resolves #732) 2013-10-04 14:01:55 +02:00
Alex Szpakowski 6eee23c8fc Cleaned up the incompatibility warning message and fixed it to actually display on the screen (resolves issue #707) 2013-09-20 17:50:59 -03:00
Alex Szpakowski 67a807f79c The first frame's delta time no longer includes the time taken to load main.lua and call love.load, in the default love.run. 2013-09-20 03:39:40 -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 040defbbfe Renamed love.mouse.setGrab to love.mouse.setGrabbed (resolves issue #720) 2013-08-28 19:13:17 -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