Screen Shots and more

posted in Yar
Published February 09, 2005
Advertisement
On windows 98, Thread.sleep() is poorly accurate (minimum sleep is 50 ms, so Thread.sleep(1, 2, 3...) == Thread.sleep(50) ). The timer gets better on later versions of windows, but still under what we expect off of Linux Solaris, and macs.

http://www.mactech.com/articles/mactech/Vol.14/14.05/WritingJavaCross-Platform/
This links to an article with some help with threads based on the mac. Evidently the biggest thing that is handled differently on the mac is how the threads operate... So I went to work and redid a bunch of the Java2D code, and now with Thread.yield() I can get up to 500FPS, but an average of about 150... not too bad! Now, all I have to do is see if it works on windows better then the last build...

Anyway, screenshots!!




The First one is with 'Smart Render Mode', Second one without it, and the third one is what happens when the FPS is too low.

The reason there is a black bar on the bottom of the first one, is so that when the game isn't refreshing, the FPS and the Load still are. So in order to keep from having to triple buffer, I just blacked out that section... why not? it is only for debugging right?

I'm heading back into VPC to recompile with JSmooth... new demo should be up soon.
Previous Entry OpenGL
Next Entry Demo now up!
0 likes 3 comments

Comments

Muhammad Haggag
Quote:On windows 98, Thread.sleep() is poorly accurate (minimum sleep is 50 ms, so Thread.sleep(1, 2, 3...) == Thread.sleep(50) ). The timer gets better on later versions of windows, but still under what we expect off of Linux Solaris, and macs.

According to this article:

Operating System  	       System Clock
Windows 95, 98 	                55 ms
Windows NT, Uniprocessor HAL 	10 ms
Windows NT, Multiprocessor HAL 	15 ms
Windows NT 4.0 Alpha 	        7.5 ms


However, by default on Win2K and XP, Sleep takes at least 10 ms. That can be changed with some system call that I don't recall.
February 10, 2005 12:26 AM
H_o_p_s
Yeah, I gave up on the Thread.sleep() and went with the Thread.yield(). I'm hoping that when I release this next build that it will be running better on more systems. But I must say that changing over to the yield() made a dramatic improvement in speed. The next thing I'm going to do is go through my SpriteCache class and rid of it the Strings that I use for references. Int values should calculate faster than Strings...
February 10, 2005 02:23 AM
Rob Loach
SmartRender it up!
February 10, 2005 06:05 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

!!!!!!!

671 views

MIDI Keyboard v1.7

1540 views

Yar.

1209 views

Orchestra Recording

1324 views

MIDI Keyboard v1.5

1459 views

Registration

1324 views

Ahhh!!!

1090 views

Um... yeah...

1076 views
Advertisement