We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware Bugs › text image and opengl
Page Index Toggle Pages: 1
text image and opengl (Read 903 times)
text image and opengl
Apr 1st, 2006, 4:47pm
 
I've discovered a patch for an annoying opengl bug of fusing the memory of images on the forum. This is especially apparent with the video library running at the same time.

One simply uses PImage.updatePixels() before using any image.

But I'm using text as well. That's more images that are getting corrupted. I get odd goings on with the text and such.

Is there anyway to reach in and perform an updatePixels() on the text in memory, or am I going to have to make a whole font  from scratch?
Re: text image and opengl
Reply #1 - Apr 1st, 2006, 8:05pm
 
take a look at the source for PFont, there's an array of images in there you could just brute-force call to updatePixels on all of em. this won't necessarily work in future releases, but it may for the near-term until i can get the bug fixed (prolly next few weeks).
Re: text image and opengl
Reply #2 - Apr 2nd, 2006, 2:36pm
 
I tried the following code before presenting text:
Code:

void glTextPatch(){
for(int i = 0; i < font.images.length; i++){
font.images[i].updatePixels();
}
}

And it kinda makes it worse. Instead of the text getting garbled with the rest of the images in memory, the text gets garbled with itself. I even tried loadPixels() instead.
Re: text image and opengl
Reply #3 - Apr 2nd, 2006, 8:29pm
 
such is the nature of hacks. guess you'll just have to wait for the fix or dig in the code to help contribute to the fix.
Re: text image and opengl
Reply #4 - Apr 2nd, 2006, 9:00pm
 
I'm okay for the moment, I found a solution round the problem (and made my whole project isometric as well - there goes my Sunday). Before any one follows the link though, I would warn that this is by no means a fix for PFont in OPENGL.
Re: text image and opengl
Reply #5 - Apr 14th, 2006, 3:52am
 
fixed for 0112:
http://dev.processing.org/bugs/show_bug.cgi?id=322
Page Index Toggle Pages: 1