Commit Graph

943 Commits

Author SHA1 Message Date
Alexander Szpakowski 79fa42d207 made ShaderEffects individully handle texture units for sent images/canvases, added GL helper function for quickly binding a texture to a specific texture unit, hopefully made ShaderEffects load and unload volatile better 2012-12-22 00:29:11 -04:00
Alexander Szpakowski 16f925affa improved GL texture binding api to take texture units into consideration 2012-12-21 20:35:32 -04:00
Alexander Szpakowski 5626b74b79 reduced unnecessary usage of glUseProgram, shadereffect is now properly detached in unloadVolatile and reattached if necessary in loadVolatile, made current and max texture units static to prevent different shaders from overwriting the value of different texture units 2012-12-21 17:43:47 -04:00
Alexander Szpakowski 5252ed28cd changed shadereffect texture image unit counter and map to be non-static, get max texture units from max combined TIUs instead of max fragment shader TIUs, added the current MVP matrix as an argument to the vertex shader transform function, reduced code duplication in ShaderEffect::sendImage and sendCanvas 2012-12-21 05:03:50 -04:00
Alexander Szpakowski 0611234067 changed PixelEffect name to ShaderEffect, added lua-side support for vert/frag shader combinations with love.graphics.newShaderEffect, added tentative support for single-file vertex+fragment shaders 2012-12-20 21:51:31 -04:00
Alexander Szpakowski 28e3b105e9 added C++side support for combinations of vertex and fragment shaders in pixeleffects 2012-12-20 03:42:48 -04:00
Alexander Szpakowski a8dc813258 Text drawing performance improvements (issue #532) 2012-12-15 22:18:40 +01:00
Bart van Strien 68a895e7c6 Catch errors in love.font.newRasterizer, add luax_pconvobj which pcalls, allowing love.graphics.newFont to clean up before re-erroring 2012-12-15 14:26:46 +01:00
Bart van Strien 82ea98aa65 Disable Data:getPointer (issue #520) 2012-12-15 14:13:23 +01:00
Bart van Strien b10ff8da42 Apply patch that fixes File:read from reading too much (on EOF) (bug #530) 2012-12-15 13:58:34 +01:00
vrld 62e2c752e5 More verbose VertexIndex::getType() (using numeric_limits) 2012-12-01 14:00:05 +01:00
vrld b0abcbda71 Fix: Returning wrong type in VertexIndex::getType() 2012-11-28 16:14:10 +01:00
vrld 8bbf68c69c Match types in VertexIndex::getType() 2012-11-28 16:01:04 +01:00
vrld dcfc18192d Fix issue #494: Source:getDistance doesn't work 2012-11-23 10:24:15 +01:00
vrld b2f1408b12 Fix issue #495: Large spritebatches doesn't render properly 2012-11-23 10:23:44 +01:00
vrld 7c2889afae Fix issue #514: Redundant if-clause in ImageData::paste 2012-11-23 09:12:07 +01:00
vrld 6882c2c32c Close issue #519: Maximum stack depth reached error message. 2012-11-23 09:08:36 +01:00
vrld c782093374 Intel gets their way 2012-11-22 21:24:43 +01:00
vrld a35b4232e1 Use opengl buffer ARB constistently in VertexBuffer. 2012-11-22 21:07:35 +01:00
vrld 6ffb9d28f0 VertexBuffer/SpriteBatch speed tweaks.
- VertexBuffer holds permanent copy of the vertex data and is only read from
  GPU memory was written outside a sb:bind()/sb:unbind() pair.

- "Orphan" the current GPU buffer on unmap() before uploading the changed data
  to the GPU to avoid implicit synchronisation lags.
2012-11-22 20:59:47 +01:00
Bart van Strien 4de936ed75 Fix love.physics.getDistance 2012-11-19 21:10:28 +01:00
Bart van Strien d24c0344c8 Make second argument to setDefaultImageFilter Image:setFilter and Image:setWrap optional, and default to the first 2012-11-18 19:18:37 +01:00
Bart van Strien 3a47bafd41 Add Source:isPlaying 2012-11-18 19:01:51 +01:00
Bart van Strien 94516e2290 Catch possible exceptions thrown when locking a SpriteBatch twice 2012-11-18 18:48:37 +01:00
rude 54498ce378 Apply slime73's ParticleSystem patch. 2012-11-18 11:02:30 +01:00
rude 2149ecdf44 Use "L" to force wide literal string.
If multi-byte character set is chosen, TEXT() does not produce a wide string,
causing compilation errors.
2012-11-18 10:53:17 +01:00
vrld 31f98ebf52 Fix #234 again. Of course this means the texture coordinates are flipped
again...
2012-10-18 13:29:13 +02:00
vrld f3bf2bbfe5 Fix bug where the compat message crashed love.
If in conf.lua `t.screen' is set to false or nil, the OpenGL context will not
be initialized, leading to a crash in 'Font::print()' when printing the compat
message later on.
2012-10-17 18:36:32 +02:00
vrld 6c850fdc98 Possibly (code in issue does not fail on my machine) fix #486. Please test. 2012-10-15 17:13:08 +02:00
Bart van Strien 33d7115887 Make love.sound.newDecoder accept FileData, and make File->read return FileData 2012-10-14 17:19:40 +02:00
vrld e6711b2837 Fix multiplicative blend mode. 2012-10-12 13:52:16 +02:00
vrld 48f5afcc0e Throw error if invalid canvas type was supplied in l.g.newCanvas() 2012-10-12 13:14:40 +02:00
vrld ccdf6e1c00 Fix Issue #476: Add HDR Canvas (thanks, Alexander Szpakowski!).
* Add `love.graphics.isSupported("hdrcanvas")' to query whether the hardware
  actually supports HDR canvases.

* Add optional third argument to `love.graphics.newCanvas(w,h, type)', where
  `type' is one of "normal" or "hdr" and defaults to "normal". HDR canvases
  use floating point that can have values > 1 to store pixels, allowing for
  HDR rendering and other higher level lighting techniques when combined with
  pixel effects.

* Add `canvas:getType()'.
2012-10-11 22:22:10 +02:00
vrld c75bc199ae Remove ARB checks in PixelEffect::isSupported().
ARB fragment shaders shouldn't support GLSL 1.2 anyway.
2012-10-04 17:27:31 +02:00
vrld 5e3e24dcfb love.run(): Sleep after presenting graphics buffer.
Less sluggish controls w/o vsync.
2012-10-01 22:11:51 +02:00
vrld a39ddc9f1a Close issue #480: Extending Canvas support to cards without packed depth stencil. 2012-10-01 22:06:56 +02:00
vrld e35854acdc Remove love_ScreenSize from shaders.
PixelEffects would fail to load when screen_coords were unused.

Reopens issue #435: "PixelEffects have flipped screen_coords.y".
2012-10-01 21:39:52 +02:00
vrld e575c86246 Severe case of premature commit-ion. 2012-09-11 16:11:26 +02:00
vrld fdf175d7d0 Partly fix issue #468: Incorrect(?) detection of shader support.
Still need to figure out if we can use the ARB versions.
2012-09-11 15:21:39 +02:00
vrld 8ba6c2b523 Fix typos and compiler warnings (see comments to 2b3afd95a23f). 2012-09-11 14:29:05 +02:00
vrld 4ec7609d37 Fix issue #437: Area-based particle spawn.
New particles are spawned around the particle emitter position according to a
configurabe distribution.

New functionality:

particlesystem:setAreaSpread(distributon, x, y)
distribution, x, y = particlesystem:getAreaSpread()

Where `distribution' is one of "none", "uniform", "normal".
`x' and `y' take different meaning based on the distribution:

  * none:    no area spread - particles spawned at emitter position.
  * uniform: particle spawned at px,py in the rectangle around emitter
             position ex,ey, i.e.:
             ex - x < px < ex + x, ey - y < py < ey + y,
  * normal:  particle position drawn from a normal/gaussian distribution
             with mean ex,ey and standard deviation x,y, i.e.:
             px \in N(ex, x²), py \in N(ey, y²).
2012-09-10 19:58:44 +02:00
vrld 50fd169e07 Add random([[min], max]) and random_normal([o]).
Little helpers for drawing numbers from bounded uniform and Gaussian
distributions.
2012-09-10 19:45:54 +02:00
vrld e9dcc16f16 Don't throw exception when loading module in thread.
The module registry throws an exception when trying to register a module
instances if an instance is already registered under the same name. This
backfired in love.thread when requiring love-modules.
2012-09-10 12:39:37 +02:00
Bart van Strien 8234e71c74 Add an ASSERT_GUARD for World:update, catching any errors occuring there 2012-08-28 17:47:23 +02:00
rude 7baf22c0e3 Apply Boolsheet's GME leak patch. 2012-08-21 16:14:38 +02:00
Bart van Strien 63daffb22f Correctly set the spacing for the last character in an ImageFont as well 2012-08-21 15:18:12 +02:00
Bill Meltsner b24e7ab64f Update the Xcode project and enable GME support on OS X.
Requires Game_Music_Emu.framework, which is included in the updated OS X SDK.
2012-08-18 11:56:42 -05:00
vrld 87c6646705 Fix #435 (for real this time). Unfixes #324.
Add a extern vec2 love_ScreenSize to the pixel effects that will
be (re)set upon PixelEffect::loadVolatile() and is used to flip
the fragment coordinate.

Unfixes #324 because canvases can have different dimensions than
the screen.
2012-08-05 16:08:22 +02:00
vrld 1fd12e4596 Add Module::registerInstance() and Module::getInstance().
Module::registerInstance() registers a module instance which can later
be retrieved using Module::getInstance().

registerInstance() is called in luax_register_module().

getInstance() expects the full name (as returned by Module::getName())
of the requested module.
2012-08-05 16:03:37 +02:00
vrld 6f1ff69b61 Fix issue #435: PixelEffects have flipped screen_coords.y. 2012-08-03 19:39:41 +02:00