www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on February 01, 2018, 03:35:33 am

Title: Drawing a Graphic on a Separate Thread
Post by: AGP on February 01, 2018, 03:35:33 am
Hardware renderer in (lwjgl's frame) fullscreen throws a RuntimeException ("No OpenGL context found in the current thread."). I created a WorldProcessor with two threads as well as tried it the lwjgl way (GLContext.useContext()). Neither worked.
Title: Re: Drawing a Graphic on a Separate Thread
Post by: EgonOlsen on February 01, 2018, 09:31:01 am
Why would you want to do that? The GPU has to serialize the rendering anyway...
Title: Re: Drawing a Graphic on a Separate Thread
Post by: AGP on February 01, 2018, 05:34:44 pm
It's a pre-splash graphic that's meant to run while the game is loading. Load time is as much as 20 seconds and I don't want a black or even just a static screen for that long.
Title: Re: Drawing a Graphic on a Separate Thread
Post by: AGP on February 02, 2018, 09:35:50 pm
So, do you have a response?
Title: Re: Drawing a Graphic on a Separate Thread
Post by: EgonOlsen on February 05, 2018, 09:44:18 am
Then why don't you do the loading in a different thread and let the main thread render the splash screen? That's what I'm doing in Naroth as well.
Title: Re: Drawing a Graphic on a Separate Thread
Post by: AGP on February 06, 2018, 06:36:09 pm
That makes sense, thanks.