Mac_Systems
Junior Devvie  
I love my Java
|
 |
«
Posted
2003-08-08 06:49:17 » |
|
Good Morning,  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
|
|
|
|
Matzon
|
 |
«
Reply #1 - Posted
2003-08-08 07: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);
|
|
|
|
Mac_Systems
Junior Devvie  
I love my Java
|
 |
«
Reply #2 - Posted
2003-08-08 07:35:44 » |
|
hmmm,  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
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Matzon
|
 |
«
Reply #3 - Posted
2003-08-08 07:43:30 » |
|
Did you gave the LWJGL lib for default such a high Priority? Yes, this is a game library... 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...
|
|
|
|
Markus_Persson
|
 |
«
Reply #4 - Posted
2003-08-08 07:45:27 » |
|
Quake 2 and 3 both run very well in windowed mode. They even release the mouse when the console is down. 
|
|
|
|
Mac_Systems
Junior Devvie  
I love my Java
|
 |
«
Reply #5 - Posted
2003-08-08 07: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
|
|
|
|
Matzon
|
 |
«
Reply #6 - Posted
2003-08-08 08:25:05 » |
|
Quake 2 and 3 both run very well in windowed mode. They even release the mouse when the console is down.  Yeah, but the point being that they don't cap framerate just because it's in windowed mode!
|
|
|
|
Matzon
|
 |
«
Reply #7 - Posted
2003-08-08 08:28:22 » |
|
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. 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. 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 ?
|
|
|
|
Mac_Systems
Junior Devvie  
I love my Java
|
 |
«
Reply #8 - Posted
2003-08-08 10:46:34 » |
|
Jep,
org.lwjgl.DisplayMode !
|
|
|
|
Matzon
|
 |
«
Reply #9 - Posted
2003-08-08 11:03:01 » |
|
import org.lwjgl.DisplayMode; should do the trick  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!
|
|
Mac_Systems
Junior Devvie  
I love my Java
|
 |
«
Reply #10 - Posted
2003-08-08 11: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  - Jens
|
|
|
|
princec
|
 |
«
Reply #11 - Posted
2003-08-08 13:04:01 » |
|
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 
|
|
|
|
Mac_Systems
Junior Devvie  
I love my Java
|
 |
«
Reply #12 - Posted
2003-08-08 13:08:20 » |
|
Then you should rename the class.
- Jens
|
|
|
|
Matzon
|
 |
«
Reply #13 - Posted
2003-08-08 13:32:15 » |
|
nah
|
|
|
|
Mojomonkey
|
 |
«
Reply #14 - Posted
2003-08-08 13: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.
|
|
|
Mac_Systems
Junior Devvie  
I love my Java
|
 |
«
Reply #15 - Posted
2003-08-08 14: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
|
|
|
|
Markus_Persson
|
 |
«
Reply #16 - Posted
2003-08-08 15: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. 
|
|
|
|
cfmdobbie
Senior Devvie    Medals: 1
Who, me?
|
 |
«
Reply #17 - Posted
2003-08-09 11:08:40 » |
|
Do you mean org.lwjgl.Sys?  And org.lwjgl.Math appears to have been culled from the next release, as well! 
|
Hellomynameis Charlie Dobbie.
|
|
|
cfmdobbie
Senior Devvie    Medals: 1
Who, me?
|
 |
«
Reply #18 - Posted
2003-08-09 11: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.
|
|
|
Markus_Persson
|
 |
«
Reply #19 - Posted
2003-08-09 11:28:50 » |
|
Oh, it's Sys? Sorry, I was just trolling a bit.  LWJGL really is a great piece of work though, to be serious. 
|
|
|
|
Mac_Systems
Junior Devvie  
I love my Java
|
 |
«
Reply #20 - Posted
2003-08-09 12: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
|
|
|
|
|