Page 1 of 1

Cannot load no square image

Posted: Thu Dec 19, 2013 7:20 pm
by edd
Hello, i've just test löve 0.9.0 on windows 8.1 (it's the first time i test löve). Seem work fine, thank's for your work.

this is my problem :

I want load a tileset png image and draw some quad.
This tileset have a 768x2304 px.

Code: Select all

function love.load()
	Tileset = love.graphics.newImage('a.png')
	GrassQuad = love.graphics.newQuad(0, 0,64, 128, Tileset:getWidth(), Tileset:getHeight())	
end

function love.draw()
	love.graphics.draw(Tileset, GrassQuad, 200, 400)
end
But result is a blank quad on my screen.

Related to old post forum, this is like a PO2 syndrom (viewtopic.php?f=4&t=3815), but this bug was resolv with 0.8.0 version.

* I have test this workarround without result : https://love2d.org/wiki/ImageData#Examples
* I have test with a power of 2 width and height without result.
* I have test with a real square image (768x768) and .... it's work !

So ... any image load by löve need to be a square ? what i have missed ?

Re: Cannot load no square image

Posted: Thu Dec 19, 2013 7:26 pm
by bartbes
I imagine your graphics card simply can't handle a texture that big.

Re: Cannot load no square image

Posted: Thu Dec 19, 2013 8:52 pm
by slime
What are the values of love.graphics.isSupported("npot") and love.graphics.getMaxImageSize() for you? Very low-end GPUs can't create images with widths or heights greater than 2048.

Re: Cannot load no square image

Posted: Fri Dec 20, 2013 5:01 pm
by edd
npot => false
getMaxImageSize => 1024

I have my response, thank's !

This value (maxImageSize) seem come from my system configuration: ("The returned number depends on the system running the code. It is safe to assume it will never be less than 1024 and will almost always be 2048 or greater. "). It's strange, i have already use same tilepack png with an sdl program on same computer but under linux without any problem.

This value come from system configuration or deduct by löve for best usage ?

Re: Cannot load no square image

Posted: Fri Dec 20, 2013 6:28 pm
by bartbes
It's the maximum OpenGL texture size reported by your driver. Be sure to make sure you've got up-to-date graphics drivers to get the best results. As for drawing it using SDL, that's software rendering, so that is not directly related.