Run LWJGL library without rendering?

Started by elias4444, June 29, 2008, 18:38:11

Previous topic - Next topic

elias4444

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?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Matzon

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?

Matthias

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.

elias4444

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.  :-\
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias4444

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?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Matzon

its shit on multicore and more so on speedstep and similar.

elias4444

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?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Matzon

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.

oNyx

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.)