Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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  
  Code Request: JNI timer  (Read 3669 times)
0 Members and 1 Guest are viewing this topic.
Offline GergisKhan

Junior Duke




"C8 H10 N4 O2"


« Posted 2002-12-31 03:40:27 »

I was thinking that it might help if we could get both a Windows and a Mac version that would not be subject to the licensing issues of the J3D timer.  I would do this myself but I have no idea how to access anything Windows-based.  Oh yeah, perhaps a Linux version as well.

Anyone know how easy/hard this is?  I'd love to learn how to do this.

gK

"Go.  Teach them not to mess with us."
          -- Cao Cao, Dynasty Warriors 3
Offline elias

Senior Duke





« Reply #1 - Posted 2002-12-31 06:51:01 »

Look in the lwjgl source in the Sys class. We have native timers for linux and win32 in there. It's bsd licenced so you can steal it if you like it. Or better yet - use the entire lwjgl for your gaming desires ;-)

P.S ... And the mac version is under way - gregory is working on it in these days.

- elias

Offline whome

Junior Duke




Carte Noir Java


« Reply #2 - Posted 2003-01-22 10:03:00 »

See this article about JNI timer. Maybe it gives you some ideas.
http://www.javaworld.com/javaworld/javaqa/2003-01/01-qa-0110-timing.html?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline GergisKhan

Junior Duke




"C8 H10 N4 O2"


« Reply #3 - Posted 2003-01-22 12:50:37 »

Thanks for the article.  Anyone know anything about the Mac version of such a thing?

GAWD I need to learn low-level UNIX programming again.


gK

"Go.  Teach them not to mess with us."
          -- Cao Cao, Dynasty Warriors 3
Offline ryanm

Senior Duke


Projects: 1
Exp: 15 years


Used to be bleb


« Reply #4 - Posted 2003-01-22 13:30:34 »

Quote
Oh yeah, perhaps a Linux version as well.


I was under the impression that linux already has millisecond accuracy with System.currentTimeMillis().  Is that mistaken?  I've never had any granularity issues before.
Offline GergisKhan

Junior Duke




"C8 H10 N4 O2"


« Reply #5 - Posted 2003-01-22 22:42:38 »

No, I think you are right.  But with JNI it is possible for a timer to give sub-millisecond timings.... I think it is in the order of 10 MICROsecond at that point.

Which is MORE than fine for animation. Smiley

gK

"Go.  Teach them not to mess with us."
          -- Cao Cao, Dynasty Warriors 3
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #6 - Posted 2003-01-23 01:17:35 »

There seems to be some sort of timer in the MIDI stuff of Java Sound..  I know nothing about it though.. but i'm windering, if you have a MIDI device (i.e. most game PC will have one on the sound card) could you use it somehow?

Offline GergisKhan

Junior Duke




"C8 H10 N4 O2"


« Reply #7 - Posted 2003-01-23 01:53:32 »

I think someone tried it once, and reported back on this forum that it did not work... similar problems as with System.getCurrentTimeMillis()

gK

"Go.  Teach them not to mess with us."
          -- Cao Cao, Dynasty Warriors 3
Offline GergisKhan

Junior Duke




"C8 H10 N4 O2"


« Reply #8 - Posted 2003-01-23 01:55:17 »

I think someone tried it once, and reported back on this forum that it did not work... similar problems as with System.getCurrentTimeMillis()

gK

"Go.  Teach them not to mess with us."
          -- Cao Cao, Dynasty Warriors 3
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #9 - Posted 2003-01-23 11:52:02 »

LWJGL has a good timer so why not use it? Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline GergisKhan

Junior Duke




"C8 H10 N4 O2"


« Reply #10 - Posted 2003-01-23 13:00:17 »

LWJGL is on my list of technologies to use when we move my game in six months to a year from a 2D to a 3D model.  It makes NO sense at that point to stay pure Java, and OpenGL is the only way to go.  Unfortunately, at this time the support i need, which is Mac, Windows, and Linux, isn't yet completed.... so I have to wait.

But I will be using it.... it's a GREAT project.

gK

"Go.  Teach them not to mess with us."
          -- Cao Cao, Dynasty Warriors 3
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.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (42 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (85 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!