Slick Forums

Discuss the Slick 2D Library
It is currently Tue May 21, 2013 2:02 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon Jan 11, 2010 1:21 am 
Offline
Site Admin

Joined: Mon Dec 08, 2008 2:17 pm
Posts: 140
I noticed a couple of times that the text drawn by g.drawString and font.drawString tend to randomly start moving between the different render points.
I remember that Kev said that there was a bug in the font cache. It looks that's exactly what I'm having.

I noticed following patterns:
At startup the texts are always located correctly
randomly starts changing text rendering between font render positions. 'when some time has passed'
Hard to reproduce

Fonts used:
AngelCodeFont
UnicodeFont

It looks like when rendering a new text string the text is (re)used in the next render call
based on this ss

see http://battle.customwars.com/temp/ for screenshots.
see discussion1 and discussion2
related to http://slick.javaunlimited.net/viewtopic.php?t=2205
Slick Build #270


Last edited by Stef on Wed Mar 31, 2010 12:29 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 07, 2010 7:25 am 
Offline
Regular

Joined: Sun Dec 07, 2008 5:22 am
Posts: 238
Location: Vancouver, BC, Canada
I just encountered the same bug.
I have a unit on the screen with its health rendered in text.
The proper health is displayed for a little while and then it is replaced with the fps count.
As mentioned in one of the discussions this is only happens when many different strings are drawn.

Slick Build #270
LWJGL Version: 2.1.0

_________________
If at first quads don't succeed tri tri again.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 08, 2010 5:13 pm 
Offline

Joined: Sat Feb 06, 2010 4:29 pm
Posts: 40
Me too,
I only use g.drawString and g.drawLine.

After 2sec FPS count is on ever drawString.

when i set app.setShowFPS(false);

one string is on all positions.


Slick Build #270
LWJGL Version: 2.0b1


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 08, 2010 5:32 pm 
Offline

Joined: Wed Jan 27, 2010 4:23 pm
Posts: 10
I ran into this as well. Using a font that does not do display caching seems to fix the problem for me.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 08, 2010 6:09 pm 
Offline

Joined: Sat Feb 06, 2010 4:29 pm
Posts: 40
tireswing wrote:
I ran into this as well. Using a font that does not do display caching seems to fix the problem for me.


which?
how?


(neverless BUG should be fixed)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 08, 2010 7:28 pm 
Offline
Regular
User avatar

Joined: Thu May 21, 2009 10:25 am
Posts: 161
Location: France
Hi all !

I've got this problem too. Benoit talk about it and fix it with a patch in discussion 2.

Hope it will be fixed in future release.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 08, 2010 8:04 pm 
Offline

Joined: Wed Jan 27, 2010 4:23 pm
Posts: 10
Quote:
which?
how?

When creating an instance of AngelCodeFont for instance, you can use a constructor that allows you to pass an argument to specify whether display caching is enabled...

Code:
Font myFont = new AngelCodeFont("res/data/fontfile.fnt", "res/data/fontpic.png", false);

The false disables display caching.

When using UnicodeFont, once the Unicode font is created, call setDisplayListCaching.

Code:
UnicodeFont font;
// ... create font here...
// ...
font.setDisplayListCaching(false);


This bug exists with the display list caching part. I agree it should be fixed, but to work around it, you can disable display list caching.

Cheers,
Joe


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 04, 2010 11:04 am 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Applied Benoit's fix from the other thread.

In SVN.

Kev


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group