Cannot load no square image

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
edd
Prole
Posts: 2
Joined: Thu Dec 19, 2013 6:47 pm

Cannot load no square image

Post 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 ?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Cannot load no square image

Post by bartbes »

I imagine your graphics card simply can't handle a texture that big.
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Cannot load no square image

Post 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.
edd
Prole
Posts: 2
Joined: Thu Dec 19, 2013 6:47 pm

Re: Cannot load no square image

Post 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 ?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Cannot load no square image

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests