MovingBlocks / box2d-editor

Automatically exported from code.google.com/p/box2d-editor - migrated here to maybe maintain together with Destination Sol. Original website:
https://code.google.com/archive/p/box2d-editor/
Apache License 2.0
84 stars 21 forks source link

NPE on startup: need to request use of GL 3.0 #35

Closed smr99 closed 7 years ago

smr99 commented 7 years ago

Running under linux, I obtain a NPE immediately on startup:

java.lang.NullPointerException
    at aurelienribon.bodyeditor.canvas.Canvas.resize(Canvas.java:142)
    at com.badlogic.gdx.backends.lwjgl.LwjglCanvas.create(LwjglCanvas.java:191)
    at com.badlogic.gdx.backends.lwjgl.LwjglCanvas$1.addNotify(LwjglCanvas.java:88)
       [...]

The line that breaks is: Gdx.gl30.glViewport(0, 0, width, height); because Gdx.gl30 is null. Apparently, you need to request use of GL3.0; see https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/backends/lwjgl/LwjglApplicationConfiguration.html#useGL30


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

smr99 commented 7 years ago

So as you can see from above, I now have a commit in my fork that fixes this. Still working out how I can cherry-pick this one commit as a pull request. If I fail, maybe you can just do the merge anyway.

Cervator commented 7 years ago

Hey there!

Thank you so much for finding and fixing that. We got stuck on trying to fix this on the latest LibGDX at the time and are lacking rendering experts to figure out what remains to be fixed.

Did you see the https://github.com/MovingBlocks/box2d-editor/tree/tweaking branch? There are a few more commits there attempting to fix things that your branch seems to be behind. I don't know if this issue is addressed there, been a while since I worked on it.

I don't see a problem just merging all three of your commits at once, fixing two issues, just would be good to compare them with the newer branch first :-)

smr99 commented 7 years ago

On Sunday, January 29, 2017 4:49:06 PM CST Rasmus Praestholm wrote:

Did you see the https://github.com/MovingBlocks/box2d-editor/tree/tweaking branch?

I saw the branch, but did not previously examine the commits on it. I just checked now and there is no conflict -- my changes should apply cleanly to tweaking as well.

I should also note that I could not build & run the gradle project from
Android Studio -- which is based on IntelliJ. I eventually ran "bash gradlew jar" and then I could run & debug from Android Studio. But it seems to be running the jar and I have to repeat the "gradlew jar" step after source changes. Do you build & run from an IDE?

-Steve

Cervator commented 7 years ago

Great, then hopefully we can merge everything together and then reassess what's left at that point :-)

I have run it from IntelliJ, after gradlew idea to generate project files. I don't remember if I made any customizations in IntelliJ but the workspace does look error free - I'd have to try to find some time to check it out to see if I can get it working from scratch with everything outstanding merged.

vampcat commented 7 years ago

@smr99 Can you create a pull request for this? We're working on making this editor functional again, and this would be a great starting point.