Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL in LWJGL unable to launch in xiwi window #1334

Closed
s5bug opened this issue Jan 10, 2015 · 6 comments
Closed

OpenGL in LWJGL unable to launch in xiwi window #1334

s5bug opened this issue Jan 10, 2015 · 6 comments
Assignees
Labels

Comments

@s5bug
Copy link

s5bug commented Jan 10, 2015

When in an xiwi window, my program is not able to launch because there is no screen available:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.otabi.firestar.portal.main.Portal.main(Portal.java:21)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    at org.lwjgl.opengl.XRandR.findPrimary(XRandR.java:326)
    at org.lwjgl.opengl.XRandR.ScreentoDisplayMode(XRandR.java:315)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:746)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:743)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:743)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
    ... 1 more

Which basically means this:

private static Screen findPrimary(Screen... screens) {
        for ( Screen screen : screens ) {
            if ( screen.name.equals(primaryScreenIdentifier) ) {
                return screen;
            }
        }
        // fallback
        return screens[0];
    }

And since screens[0] references the first screen, and it gives an ArrayIndexOutOfBoundsException that means that it is not there.
I know what you're thinking:
"Oh... More work on that?"
Find my code here: firestar115/PortaJ

@s5bug s5bug changed the title OpenGL in LWJGL unable to launch OpenGL in LWJGL unable to launch in xiwi window Jan 10, 2015
@dnschneid
Copy link
Owner

The xrandr code in the dummy driver isn't a complete implementation, iirc.

@s5bug
Copy link
Author

s5bug commented Jan 15, 2015

I don't know what xrandr is or what iirc is...
I do java.

 ___      .__   __. .___________. __    __    ______   .__   __.

/   \     |  \ |  | |           ||  |  |  |  /  __  \  |  \ |  |

\ \ / /
/ ^ \ | | | ---| |----| || | | | | | | | |
\ \ / /
/ /_\ \ | . | | | | __ | | | | | | . |
_ _/
/ ___
\ | |\ | | | | | | | | `--' | | |\ | | |
// **\ || *| || || || ____/ |**| *| |__|

On Mon, Jan 12, 2015 at 9:56 AM, David Schneider [email protected]
wrote:

The xrandr code in the dummy driver isn't a complete implementation, iirc.


Reply to this email directly or view it on GitHub
#1334 (comment).

@drinkcat
Copy link
Collaborator

In your code, I see Display.setDisplayMode(new DisplayMode(800, 600));. Are you trying to change resolution? That's probably a bad idea in xiwi context (we do not handle that). Can you start your application in a window?

I'm not sure why no screens are detected, though, as I see one in xrandr output. The only thing I can think about is that LWJGL might be using an older version of the xrandr protocol...

@s5bug
Copy link
Author

s5bug commented Jan 15, 2015

Display.setDisplayMode(DisplayMode mode) sets the window size, not
linux's size.

On 1/15/15, drinkcat [email protected] wrote:

In your code, I see Display.setDisplayMode(new DisplayMode(800, 600));.
Are you trying to change resolution? That's probably a bad idea in xiwi
context (we do not handle that). Can you start your application in a
window?

I'm not sure why no screens are detected, though, as I see one in xrandr
output. The only thing I can think about is that LWJGL might be using an
older version of the xrandr protocol...


Reply to this email directly or view it on GitHub:
#1334 (comment)

 ___      .__   __. .___________. __    __    ______   .__   __.

/   \     |  \ |  | |           ||  |  |  |  /  __  \  |  \ |  |

\ \ / /
/ ^ \ | | | ---| |----| || | | | | | | | |
\ \ / /
/ /_\ \ | . | | | | __ | | | | | | . |
_ _/
/ ___
\ | |\ | | | | | | | | `--' | | |\ | | |
// **\ || *| || || || ____/ |**| *| |__|

@drinkcat
Copy link
Collaborator

Could you look into LWJGL source (or file an issue on their github repo) to understand why it is trying to access screen information through xrandr? I don't see the point of doing that in windowed mode...

@s5bug
Copy link
Author

s5bug commented Jun 10, 2017

Sorry I haven't been here in a while. I have heard this has been fixed and seen evidence that it has been fixed. Thanks for the interest though!

And oh boy my internet signature back then.

@s5bug s5bug closed this as completed Jun 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants