Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting window width/height to 0 in push:setupScreen causes blank screen #40

Open
FormularSumo opened this issue Apr 17, 2021 · 2 comments · May be fixed by #46
Open

Setting window width/height to 0 in push:setupScreen causes blank screen #40

FormularSumo opened this issue Apr 17, 2021 · 2 comments · May be fixed by #46

Comments

@FormularSumo
Copy link

The minimal code to reproduce the issue:

function love.load()
push = require 'push'
push:setupScreen(1920, 1080, 0, 0)
end

function love.draw()
push:start()
love.graphics.rectangle('fill',10,10,100,100)
push:finish()
end

A window running at my desktop resolution opens but nothing within push:start() and push:finish() draws. If I move love.graphics.rectangle to be after push:finish it does draw.

If I change window width & height to any other value, either in push:setupScreen or by calling push:resize rectangle does draw.

@HTV04
Copy link
Collaborator

HTV04 commented Aug 29, 2021

Hi, sorry if I'm wrong, but while 0x0 is technically an invalid resolution, the pull request seems to add more of an enhancement rather than a bugfix. It would probably make more sense for push to detect whether windowWidth and windowHeight are nil and default to the desktop dimensions if so, instead of 0 or less which should probably throw an error instead.

I'll leave this open for a few days in case there's something I'm missing, though.

@FormularSumo
Copy link
Author

My thinking was to make push:setupScreen mirror the beheaviour of love.window.setMode, where if you give it a width/height of 0 it sets them to desktop resolution.
https://love2d.org/wiki/love.window.setMode
"If width or height is 0, setMode will use the width and height of the desktop."

At any rate the current beheaviour should probably be changed, where the window is launched at desktop resolution but can't be drawn to within push:start and push:finish.

Also my pull request is only checking for == 0, if you put in a value less than 0 (or nil) it returns an error.

@HTV04 HTV04 mentioned this issue Aug 31, 2021
@HTV04 HTV04 linked a pull request Jul 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants