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

Error push.lua:48 : bad argument # 2 to 'windowUpdateMode'(number expected, got table) #34

Closed
Empyre17 opened this issue Jul 20, 2020 · 5 comments

Comments

@Empyre17
Copy link

Please help me I'm using push library in my project ..and i copied the code push.lua provided by you in push.lua file and when i run the program this error is expected on this line of code
windowUpdateMode(self._RWIDTH, self._RHEIGHT, {
fullscreen = self._fullscreen,
resizable = self._resizable,
highdpi = self._highdpi
})
`function push:setupScreen(WWIDTH, WHEIGHT, RWIDTH, RHEIGHT, settings)

settings = settings or {}

self._WWIDTH, self._WHEIGHT = WWIDTH, WHEIGHT
self._RWIDTH, self._RHEIGHT = RWIDTH, RHEIGHT

self:applySettings(self.defaults) --set defaults first
self:applySettings(settings) --then fill with custom settings

windowUpdateMode(self._RWIDTH, self._RHEIGHT, {
fullscreen = self._fullscreen,
resizable = self._resizable,
highdpi = self._highdpi
})

self:initValues()

if self._canvas then
self:setupCanvas({ "default" }) --setup canvas
end

self._borderColor = {0, 0, 0}

self._drawFunctions = {
["start"] = self.start,
["end"] = self.finish
}

return self
end`

@Ulydev
Copy link
Owner

Ulydev commented Jul 20, 2020

Hi @Empyre17 , thanks for using push. Could you please explain your issue more in detail? How do you use the library (are you calling a function? Show a relevant part of your code e.g. main.lua), what is the error you get?
edit: I'm guessing you called push:setupScreen with the wrong number of arguments, could you show me?

@Empyre17
Copy link
Author

Empyre17 commented Jul 20, 2020 via email

@Empyre17
Copy link
Author

I also send a email, but here is where I called push:setupScreen
push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_HEIGHT, { fullscreen = false, resizable = false, vsync = true })

@Ulydev
Copy link
Owner

Ulydev commented Jul 21, 2020

I think you forgot to add the WINDOW_WIDTH argument in your code. The call to push:setupScreen should look like (VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, { ... })

@Empyre17
Copy link
Author

Yep it was that, thats the beautiful of programing, lol a simple mistake can give you headaches, and btw thanks you are my hero

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

No branches or pull requests

2 participants