[2952] in java-interest

home help back first fref pref prev next nref lref last post

Re: Finished first applet, now some questions...

daemon@ATHENA.MIT.EDU (Eric Richards)
Mon Oct 23 13:39:58 1995

Date: Mon, 23 Oct 1995 07:30:06 -0700
To: flar@bendenweyr.Eng.Sun.COM, java-interest@java.Eng.Sun.COM
From: richards@teleport.com (Eric Richards)

Jim -- thanks for your answers.  I'm enlightened!  Here's just a quick
followup to your response:

>> The first fFrameWidth gets -1.  After that, the pump seems "primed."  Is
>> there a more proper way of dealing with an Image instance after the image
>> is known to have been retrieved?
>
>(I'm assuming that you are executing these after you have done a wait
>in the MediaTracker, right?)

Yes.  Since I only have one picture I just assigned it id 0 and waited
for that id (thanks so much for providing Media Tracker).

> ... I have a
>fix to the prebeta1 MediaTracker that will get pushed out as soon as
>I can get a go-ahead from our webmaster...

Great!

>I don't understand your description of the problem here.  The 3 drawImage
>calls should not be too much overhead.  Did you fully load all of your
>images before you start trying to animate them?  What frame rate are you
>trying to drive the animation at (i.e. how much delay are you using
>between frames)?

Well, it's not clear because I did a poor job explaining.  Yes, the image
is all loaded up before any drawImage calls.  The frame rate I tried was a
delay of 40 msec (~24 frames/sec).  The odd thing is this:  when I quit the
appletviewer with "regular animation" the menu pulls down fine and the
viewer quits like a charm.  When I do the same under the sluggish
"background" animation, the GUI response is sluggish as well.  Hmm.  Well,
I'll get an example URL up soon to make this more lucid, but changes I plan
to make regarding the background option might make this all moot.

>Keep in mind that the drawImage() call will draw whatever is available
>when you call it and then return immediately even if the image wasn't
>fully drawn.  Also keep in mind that image loading is done at a lower
>priority than most threads run at.  What priority is the thread that
>controls your animation?  The threads that control repainting should
>run at Thread.MIN_PRIORITY.

You know, I notice that an object notifier is passed in.  Is there demo
that I can look at in which the notifier "catches" any situations like
incomplete drawing?

I have set the thread an MIN_PRIORITY (just out of sheer code copying).
Hey, now I know why to do it :-)

Thanks again for all the help.

   Cheers

   -- Eric


-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post