Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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  
  LWJGL with Sound and the overall Performance  (Read 2431 times)
0 Members and 1 Guest are viewing this topic.
Offline Mac_Systems

Junior Member




I love my Java


« Posted 2003-08-08 08:49:17 »

Good Morning, Grin

as i played around with the LWJGL lib, i regonized
that there are some problems with the priority.

As example, i converted the Lesson 36 from Nehe Tutorials # 36 (Render to Texture). So far so good.
If i running the standart Winamp in the background
the whole sound plackback is f*** up. Often Winamp stops the Playback complete while the demo runs.  :-/

There were several Therads running how to make a framerate control, but i think this will not fix that problem when the frame rate were limited to eg. 60 FPS!
As Alienfluxx (Demoversion) runs fine on my maschine, i am looking for the reason of that problem.

Thx

- Jens




The Network is the Music
http://www.mac-systems.de
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #1 - Posted 2003-08-08 09:17:16 »

So, your application is hogging all the cpu, yes?

You have two choices:
1 - Limit framerate (just cap to 10 FPS) - add a Thread.sleep(100) between each pass, it'll be slow as hell, but show you if the problem still exists.

2 - call setProcessPriority to set your applications thread priority to something lower than winamp's decoder thread -
Sys.setProcessPriority(Sys.LOW_PRIORITY);

Offline Mac_Systems

Junior Member




I love my Java


« Reply #2 - Posted 2003-08-08 09:35:44 »

hmmm,  Cool

the Winamp was just a example..
If i like to play sound via Java the setProcessPriority
could be the one call make all better.

But sleep or yield or waht ever could not be the right solution for any performance/fps problem.
If the CPU takes 100% perfomance it is good when running in Fullscreenmode , but in Windowed mode there must somthing like a FPS contol.

Did you gave the LWJGL lib for default such a high Priority ?

- Jens

The Network is the Music
http://www.mac-systems.de
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #3 - Posted 2003-08-08 09:43:30 »

Quote
Did you gave the LWJGL lib for default such a high Priority?

Yes, this is a game library...

Quote
If the CPU takes 100% perfomance it is good when running in Fullscreenmode , but in Windowed mode there must somthing like a FPS contol.

No. If you feel that your application should NOT hog the CPU then this is your responsibility. This is not something that should be decided by the library.

Try running Quake or the likes in windowed mode...

If I were making minesweeper with LWJGL, I would most likely do it in windowed mode, and cap framerate at 30 or so. Even better I would probably not have any framerate what so ever - I'd just paint when isDirty is true...

Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #4 - Posted 2003-08-08 09:45:27 »

Quake 2 and 3 both run very well  in windowed mode. They  even release the mouse when the console  is down. Wink

Play Minecraft!
Offline Mac_Systems

Junior Member




I love my Java


« Reply #5 - Posted 2003-08-08 09:50:40 »

For sure that the CPU must do the Work in FullscreenMode, but in Windowed Mode with a bit more
CPU intensiv there should be something like FPS Control !
What about the other OS ? If i set the priotity to a lower level, how it is done on eg. Linux Systems ?

Bye the Way, why is there a Class DisplayMode in LWJGL ? Im confusing about this, you should rename it,
cause i dont like code with full classnames to keep the overview of the Source...nobody writes code like this:

1  
java.lang.String string = lwjgl.String.getString();



- Jens

The Network is the Music
http://www.mac-systems.de
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #6 - Posted 2003-08-08 10:25:05 »

Quote
Quake 2 and 3 both run very well  in windowed mode. They  even release the mouse when the console  is down. Wink

Yeah, but the point being that they don't cap framerate just because it's in windowed mode!

Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #7 - Posted 2003-08-08 10:28:22 »

Quote
For sure that the CPU must do the Work in FullscreenMode, but in Windowed Mode with a bit more
CPU intensiv there should be something like FPS Control !

Sure, but YOU should add it to your game - not LWJGL.

Quote
What about the other OS ? If i set the priotity to a lower level, how it is done on eg. Linux Systems ?

same as in windows... You just set the priority of the application - and the OS scheduler takes care of the rest.

Quote
Bye the Way, why is there a Class DisplayMode in LWJGL ? Im confusing about this, you should rename it,
cause i dont like code with full classnames to keep the overview of the Source

org.lwjgl.DisplayMode ?

Offline Mac_Systems

Junior Member




I love my Java


« Reply #8 - Posted 2003-08-08 12:46:34 »


Jep,

org.lwjgl.DisplayMode !






The Network is the Music
http://www.mac-systems.de
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #9 - Posted 2003-08-08 13:03:01 »

import org.lwjgl.DisplayMode; should do the trick Huh

if java.awt.DisplayMode is your concern, just don't import java.awt.*; it's a bad habit anyway - which results in *exactly* these problems...

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

Junior Member




I love my Java


« Reply #10 - Posted 2003-08-08 13:09:33 »

You are not understand what i try to say ...

Why there are the DisplayMode in org.lwjgl ?
You also could use the normal class avaible in
java.awt package!

Is there any other DisplayMode given back as using
GraphicDevice class via getDisplayModes() Method ?

Sorry 4 all these supid Questions  Grin

- Jens

The Network is the Music
http://www.mac-systems.de
Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #11 - Posted 2003-08-08 15:04:01 »

Quote
You also could use the normal class avaible in
java.awt package!

Oh no we couldn't! We have no dependency on the AWT packages at all. LWJGL is designed to operate without any AWT.

Cas Smiley

Offline Mac_Systems

Junior Member




I love my Java


« Reply #12 - Posted 2003-08-08 15:08:20 »

Then you should rename the class.

- Jens

The Network is the Music
http://www.mac-systems.de
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #13 - Posted 2003-08-08 15:32:15 »

nah

Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #14 - Posted 2003-08-08 15:51:20 »

Mac_Systems:

You forget that this is one of the main things packages are used for. By providing a name space two classes of the same name can exist and exist happily. Look at Vector... there are tons of Vector going around (java.util.Vector, lwjgl's Vector, I have my own Vector, etc).

namespaces are a feature.

Don't send a man to do a monkey's work.
Offline Mac_Systems

Junior Member




I love my Java


« Reply #15 - Posted 2003-08-08 16:23:58 »

hmmm.

maybe, but for me it it bad Code Design!
Java Newbies will confuse this  :o

If for example you work with XML there are serveral
Document Objects from Xerces to JDOM, if you have to convert one Document Object into the other the code
looks like sh**.  Somebody else reading this will ask itself
"hey what da heck he is doing there ?"


But ok, i will stop this stuipd questions now!

- Jens




The Network is the Music
http://www.mac-systems.de
Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #16 - Posted 2003-08-08 17:23:56 »

Personally, I don't mind duplicate class names at all when they're used in different areas. The exception is when naming classes as the same as any in the java.lang package. That's a big no-no.


Like org.lwjgl.Math or org.lwjgl.System. Wink

Play Minecraft!
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #17 - Posted 2003-08-09 13:08:40 »

Do you mean org.lwjgl.Sys? Tongue

And org.lwjgl.Math appears to have been culled from the next release, as well! Wink

Hellomynameis Charlie Dobbie.
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #18 - Posted 2003-08-09 13:17:42 »

@Mac_Systems, re: DisplayMode:  It's very, as in highly unlikely that you'd ever have java.awt.DisplayMode and org.lwjgl.DisplayMode in the same application, let alone the same source file.  I wouldn't worry about it, you'll get used to it.

Hellomynameis Charlie Dobbie.
Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #19 - Posted 2003-08-09 13:28:50 »

Oh, it's Sys? Sorry, I was just trolling a bit. Wink

LWJGL really is a great piece of work though, to be serious.  Smiley

Play Minecraft!
Offline Mac_Systems

Junior Member




I love my Java


« Reply #20 - Posted 2003-08-09 14:58:50 »

Ok,

I just have to say that the intention was the improvement of this rocking lib.
If some feels unconfortable , sorry for that!

- Jens

So back on topic  ;D

- Jens




The Network is the Music
http://www.mac-systems.de
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.

Riven (5 views)
2014-07-23 21:16:32

Riven (6 views)
2014-07-23 21:07:15

Riven (6 views)
2014-07-23 20:56:16

ctomni231 (40 views)
2014-07-18 06:55:21

Zero Volt (36 views)
2014-07-17 23:47:54

danieldean (30 views)
2014-07-17 23:41:23

MustardPeter (32 views)
2014-07-16 23:30:00

Cero (47 views)
2014-07-16 00:42:17

Riven (48 views)
2014-07-14 18:02:53

OpenGLShaders (38 views)
2014-07-14 16:23:47
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!