Difference between revisions of "PO2 Syndrome"

m (Ellipsis)
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
 
There are multiple things [[Lovers|lovers]] can do to support their poor afflicted users.
 
There are multiple things [[Lovers|lovers]] can do to support their poor afflicted users.
# Only use PO2-sized image files, as proposed at [[love.graphics.newImage]]. (One can add transparent edge for that end.)
+
# Only use PO2-sized image files. (One can add a transparent border for that end.)
# Use an ImageData object to [[ImageData#Examples|pad]] non-PO2-sized image files.
+
# Use an ImageData object to pad non-PO2-sized image files (see [[ImageData#Examples|example]]).
 
<!-- have another solution? please add it! -->
 
<!-- have another solution? please add it! -->
  
Line 15: Line 15:
 
== RichText ==
 
== RichText ==
 
Another solution, with limited scope, is the RichText library by [[User:Robin|Robin]], only for 0.7.0. See [http://github.com/gvx/richtext GitHub] for more information
 
Another solution, with limited scope, is the RichText library by [[User:Robin|Robin]], only for 0.7.0. See [http://github.com/gvx/richtext GitHub] for more information
 +
 +
== A cure has been found ==
 +
Starting version [[0.8.0]], all images are auto-padded on systems that need it, this means we can forget about all this madness and celebrate.
 +
 +
== Other Languages ==
 +
{{i18n|PO2_Syndrome}}

Latest revision as of 19:21, 19 March 2012

PO2 Syndrome (power-of-two syndrome) refers to the problem older graphic cards/drivers have: they can't display graphics whose width and height are not a power of two, that is: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, …

There are multiple things lovers can do to support their poor afflicted users.

  1. Only use PO2-sized image files. (One can add a transparent border for that end.)
  2. Use an ImageData object to pad non-PO2-sized image files (see example).

Both have a downside: getting the width, height and center of the image does not work right, which can be especially wrong for rotation. The solution is to keep the real width and height around, and use them rather than getWidth() and getHeight().

Drop-in solution

Both for users and lovers, there exists a drop-in solution (for Linux only, at the moment), based on method #2. See http://love2d.org/forums/viewtopic.php?f=5&t=1433&p=16922#p16922.

It does not take the real-size problem, described above, into account.

RichText

Another solution, with limited scope, is the RichText library by Robin, only for 0.7.0. See GitHub for more information

A cure has been found

Starting version 0.8.0, all images are auto-padded on systems that need it, this means we can forget about all this madness and celebrate.

Other Languages