Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Only 65 fps rendering empty world...  (Read 1585 times)
0 Members and 1 Guest are viewing this topic.
zahl2001
Guest
« Posted 2004-04-10 22:50:20 »

Any ideas here?

The world is absolutely empty...no drawing code whatsoever.  I mistakenly thought it would run at hundreds of frames per second.

I certainly appreciate any suggestions.
Offline GKW

Senior Member




Revenge is mine!


« Reply #1 - Posted 2004-04-11 06:19:43 »

Turn off VSync.
zahl2001
Guest
« Reply #2 - Posted 2004-04-11 13:46:28 »

Is Vsynch on by default?  I took a look in the Red Book and couldn't find any info on it. I'm aware of what it is, but not how to switch it on or off. I also checked a few demos, and didn't see any info...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2004-04-11 13:48:50 »

Its normally a setting directly on your video card driver.. on windows that would be Desktop->Properties->Settings->Advanced..

Kev

zahl2001
Guest
« Reply #4 - Posted 2004-04-11 15:10:48 »

Well, unfortunately the video card settings report that vsynch is off...which makes me think something weird must be going on.

If there are any other common newbie mistakes please let me know Smiley


Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2004-04-11 15:32:07 »

a) What OS?
b) What graphics card?
c) Is it completely fixed 65 fps, or does it drop a frame here and there?
d) What are you using to measure the FPS?
e) How about posting your code Smiley
f) Whats your monitor refresh set to?

Kev

zahl2001
Guest
« Reply #6 - Posted 2004-04-11 21:38:47 »

It seems I had a glaring error in the method of frame rate calculation, and I apologize for wasting the time of the posters.

I was using a technique I found in a book that seemed weird anyway, so I went back to just getting the time at the beginning and end of display() and subtracting them.

This yielded a result of 0 (zero) ms passing between the two points.  That still seems a little weird, but that's what I got.  Then again, I don't really know jack about OpenGL, so maybe that IS reasonable.

Thanks for the input Smiley
Offline drobbins

Senior Newbie




Java games rock!


« Reply #7 - Posted 2004-04-12 12:57:46 »

Hello All,

On this same subject, I too have had trouble coming up with an fps algorithm
I've seen some references to "precision timers" in jdk 1.5 but I' still using 1.4.2
obviously it can be done with 1.4.2. Code snippet anybody???
Offline milvich

Senior Newbie




Java games rock!


« Reply #8 - Posted 2004-04-12 15:37:08 »

Quote

I was using a technique I found in a book that seemed weird anyway, so I went back to just getting the time at the beginning and end of display() and subtracting them.

This yielded a result of 0 (zero) ms passing between the two points.  That still seems a little weird, but that's what I got.  Then again, I don't really know jack about OpenGL, so maybe that IS reasonable.


The clock in your computer isn't accurate or fast enough to generate a time delta for one frame of drawing nothing.

What you should do is create a frame counter that you increment everytime you draw and after say .25 seconds compute the FPS using your frame counter with an equation like the following.

1  
2  
3  
4  
5  
6  
7  
8  
time = getTime()
timeDelta = oldTime - time
if(timeDelta > .25s)
{
  fps = frameCount * (1.0s/timeDelta)
  frameCount = 0
  oldTime = time
}
zahl2001
Guest
« Reply #9 - Posted 2004-04-12 15:55:29 »

Thank you sir...that code would also stop the FPS display from changing so quickly you can't see the details, which I appreciate.

Z
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (22 views)
2014-04-15 18:08:23

BurntPizza (17 views)
2014-04-15 03:46:01

UprightPath (31 views)
2014-04-14 17:39:50

UprightPath (15 views)
2014-04-14 17:35:47

Porlus (31 views)
2014-04-14 15:48:38

tom_mai78101 (57 views)
2014-04-10 04:04:31

BurntPizza (115 views)
2014-04-08 23:06:04

tom_mai78101 (214 views)
2014-04-05 13:34:39

trollwarrior1 (182 views)
2014-04-04 12:06:45

CJLetsGame (189 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!