Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
NC22
Prole
Posts: 9
Joined: Sat Jul 16, 2011 12:36 am

I test LOVE game on two computers. One of them is netbook with mobile graphic card , second is usual PC. When I run game on netbook all images who have not standard size (26x26 25x25 etc) Love render as white cubes . On PC all renders fine. Have any ideas how to fix that? Is the problem of compatibility?
Attachments
rest.jpg (44.36 KiB) Viewed 1451 times

kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Contact:

That looks like a case of PO2_Syndrome
When I write def I mean function.

NC22
Prole
Posts: 9
Joined: Sat Jul 16, 2011 12:36 am

thx! Simple and helpful solution posted by Robin

Code: Select all

local nwimage = love.graphics.newImage
function love.graphics.newImage(source)
if type(source) == "string" then
source = love.image.newImageData(source)
end
local w, h = source:getWidth(), source:getHeight()
local wp = math.pow(2, math.ceil(math.log(w)/math.log(2)))
local hp = math.pow(2, math.ceil(math.log(h)/math.log(2)))
if wp ~= w or hp ~= h then
end
return nwimage(source)
end

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Not originally my code, but glad I could "help".

Also, some time in the future (probably sooner rather than later), LÖVE 0.8.0 will come out, and it has auto-padding for computers that need it, which means you don't have to worry about all that any more.

ntpspe
Prole
Posts: 31
Joined: Sun Aug 07, 2011 6:19 pm

Hmm I've never encountered this PO2 Syndrome, possibly because I always use numbers that are powers of two instinctively, seems to make more sense to me... that a bad thing?

Also, does this PO2S affect only LOVE/Lua or is it applicable to other things such as C+ e.c.t.? It's interesting to say the least, I can't understand why a graphics card can't display something just because it's not a power of 2 :L if it affects other things then hardware manufacturers should be ashamed... or are we talking win98 cards/drivers?

Ensayia
Party member
Posts: 397
Joined: Sat Jun 12, 2010 7:57 pm
Location: Middle of Nowhere, TN

PO2 syndrome is caused by graphics drivers. Nvidia cards usually don't have the problem but ATI cards do from what I hear.

vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Sometimes these errors can be fixed by updating the graphics drivers. At least with Intel cards that is.
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine

TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

vrld wrote:Sometimes these errors can be fixed by updating the graphics drivers. At least with Intel cards that is.
How do I update them on Ubuntu?

T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

TechnoCat wrote:
vrld wrote:Sometimes these errors can be fixed by updating the graphics drivers. At least with Intel cards that is.
How do I update them on Ubuntu?
In the dash, type and click on Hardware Drivers

ntpspe
Prole
Posts: 31
Joined: Sun Aug 07, 2011 6:19 pm