Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions examples/multiple-shaders/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ return function ()
local windowWidth, windowHeight = love.window.getDesktopDimensions()
windowWidth, windowHeight = windowWidth*.5, windowHeight*.5

push:setupScreen(gameWidth, gameHeight, windowWidth, windowHeight, {
fullscreen = false,
resizable = true,
highdpi = true,
love.window.setMode(windowWidth, windowHeight, {resizable = true})
push.setupScreen(gameWidth, gameHeight, {
upscale = "normal",
canvas = true
})

Expand All @@ -23,7 +22,7 @@ return function ()

shader1 = love.graphics.newShader("examples/multiple-shaders/shader1.fs")
shader2 = love.graphics.newShader("examples/multiple-shaders/shader2.fs")
push:setShader({ shader1, shader2 })
push.setShader({ shader1, shader2 })
end

function love.update(dt)
Expand All @@ -34,12 +33,12 @@ return function ()
end

function love.draw()
push:apply("start")
push.start()

love.graphics.setColor(255, 255, 255)
love.graphics.draw(image, (gameWidth-image:getWidth())*.5, (gameHeight-image:getHeight())*.5)

push:apply("end")
push.finish()
end

end
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ local examples = {
"low-res",
--[[
"single-shader",
"multiple-shaders",
--]]
"multiple-shaders",
"mouse-input"
--[[
"canvases-shaders",
Expand Down
4 changes: 2 additions & 2 deletions push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ local function applyShaders(canvas, shaders)
love.graphics.setShader(shaders[1])
love.graphics.draw(canvas)
else
local canvas = love.graphics.getCanvas()
local _canvas = love.graphics.getCanvas()
local tmp = getCanvasTable("_tmp")
local outputCanvas
local inputCanvas
Expand Down Expand Up @@ -151,7 +151,7 @@ local function applyShaders(canvas, shaders)
end
love.graphics.pop()

love.graphics.setCanvas(canvas)
love.graphics.setCanvas(_canvas)
love.graphics.draw(outputCanvas)
end

Expand Down