mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
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.
This commit is contained in:
@@ -1303,7 +1303,8 @@ do
|
||||
#define ProjectionMatrix gl_ProjectionMatrix
|
||||
#define TransformProjectionMatrix gl_ModelViewProjectionMatrix
|
||||
#define NormalMatrix gl_NormalMatrix
|
||||
uniform sampler2D _tex0_;]]
|
||||
uniform sampler2D _tex0_;
|
||||
uniform vec2 love_ScreenParams;]]
|
||||
|
||||
local GLSL_VERTEX = {
|
||||
HEADER = [[
|
||||
@@ -1335,14 +1336,22 @@ void main() {
|
||||
void main() {
|
||||
// fix crashing issue in OSX when _tex0_ is unused within effect()
|
||||
float dummy = texture2D(_tex0_, vec2(.5)).r;
|
||||
gl_FragColor = effect(VaryingColor, _tex0_, VaryingTexCoord.st, gl_FragCoord.xy);
|
||||
|
||||
// See Shader::checkSetScreenParams in Shader.cpp.
|
||||
vec2 pixelcoord = vec2(gl_FragCoord.x, (gl_FragCoord.y * love_ScreenParams[0]) + love_ScreenParams[1]);
|
||||
|
||||
gl_FragColor = effect(VaryingColor, _tex0_, VaryingTexCoord.st, pixelcoord);
|
||||
}]],
|
||||
|
||||
FOOTER_MULTI_CANVAS = [[
|
||||
void main() {
|
||||
// fix crashing issue in OSX when _tex0_ is unused within effect()
|
||||
float dummy = texture2D(_tex0_, vec2(.5)).r;
|
||||
effects(VaryingColor, _tex0_, VaryingTexCoord.st, gl_FragCoord.xy);
|
||||
|
||||
// See Shader::checkSetScreenParams in Shader.cpp.
|
||||
vec2 pixelcoord = vec2(gl_FragCoord.x, (gl_FragCoord.y * love_ScreenParams[0]) + love_ScreenParams[1]);
|
||||
|
||||
effects(VaryingColor, _tex0_, VaryingTexCoord.st, pixelcoord);
|
||||
}]],
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user