Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to write a game in Java LWJGL. And I need more than one (multiple) display window. By default I've got one display window where I can draw everything. But I'd like to split some data to other window. Any one know a way or tutorial to achieve this?

Regards.

share|improve this question
add comment

5 Answers 5

A possibility is that you could create multiple AWT windows, each with its own rendering thread and with different GLContexts. This would allow each window to have an entirely separate OpenGL context, somewhat like having multiple Displays, but requiring some extra "glue" code to get it working.

EDIT: Another interpretation of your question might be about having multiple windows inside the main game display. In that case, a better way of doing things might be to render to a framebuffer object so that you can create fake windows on-screen.

share|improve this answer
add comment

As far as I can read LWJGL code, Display is a static entity, so you'd either have to hack your way through LWJGL code or try a multi-process (not multi-threaded) approach. Multiple threads would share the state of the Display; multiple processes (separate JVMs) would not, and they could have separate windows, but transferring data and events between would be troublesome.

share|improve this answer
add comment

Did a quick check. Creating more than one Display in the same program results in an error, even if they are created in seperate Threads. One thing you can do, is to create seperate java programs for the two (or more) displays that you need, and have them communicate using sockets and/or streams.

share|improve this answer
add comment

This is just a shot in the dark, but could you create the display in a different thread? Since I know that LWJGL doesn't multithread with display/keyboard/etc., this is my best guess.

share|improve this answer
add comment

In LWJGL Display works for the thread it is called in but no where else outside of the thread. you do not need a separate process to create multiple windows.

this is what I have read in the LWJGL Wiki but please correct me if I am wrong.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.