Long story short: I'm working on a dedicated server for my new game. I use LWJGL for more than just rendering (I use Vector3f, Sys.getTime(), etc.). Only problem is, LWJGL looks for a rendering platform when it's used. So, on say a linux server without xserver installed, I get an error even though I'm not opening a window or calling any openGL commands.
Is there a flag to turn this off? Or am I going to have to make my own software library for the server?
afaik, we do not support headless environment. I do not expect anyone to work on this, but you are welcome to create a patch to support it. It might be relatively easy to patch Sys to fallback to nothing when in an headless environment?
When you only want to use Vector3f you can do so when you don't call any of the Sys, Mouse, Keyboard, Display etc. classes.
Yeah, I think it's the Sys class that's getting me. It's the only one I actually need to call since I use it my for timer. I'll just need to run the server with the java nanotime instead. :-\
Does anyone have any recent experience using nanotime() for their timer? I'm a little worried about performance from system to system. Does it run smooth across all platforms? Or do I need to find a way to make Sys.getTime() work for me?
its shit on multicore and more so on speedstep and similar.
That's what I was afraid of. I'm dividing it to make it go milliseconds, and I'm going to leave the game client using the Sys.getTime() method.
BTW, why does Sys call the graphics system with getTime() and getTimerResolution() anyway?
Quote from: elias4444 on June 29, 2008, 22:10:02
BTW, why does Sys call the graphics system with getTime() and getTimerResolution() anyway?
it doesn't. It calls its SysImplementation is either a native implementation of one of these: WindowsSysImplementation, LinuxSysImplementation or MacOSXSysImplementation.
You may be able to override: LWJGLUtil.getPlatform() and Sys.createImplementation() to allow support for headless.
If it runs on a Linux server you can just use System.currentTimeMillis(). (Sys.getTime() just calls that method on Linux since it got an accuracy of 1msec.)