Giter VIP home page Giter VIP logo

Comments (14)

mbrlabs avatar mbrlabs commented on May 18, 2024

Hello justinmeister,

thanks for the report. Unfortunally i don't have a mac to test this, but i think i know what causes this issue. In BasePicker.java i create a FrameBufferObject, that is used for offscreen rendering.
Generally you initialize it with the dimensions of the device screen, but on some devices the graphics card can't handle that. That is what your second stacktrace says.
The NPE occurs, because everything that should be initialized after the first FBO exception, is null (dispose gets called when the programs exits).

I just pushed a patch, that uses BackBuffer dimensions instead of logical pixels. I hope this solves your issue.

from mundus.

justinmeister avatar justinmeister commented on May 18, 2024

Hmm, I tried to build after updating the project and I still get the second error message that says
[Fatal] java.lang.IllegalStateException: frame buffer couldn't be constructed: incomplete attachment

The error is exactly the same as before (the second one, not the nullpointerException).

from mundus.

mbrlabs avatar mbrlabs commented on May 18, 2024

ok, can you replace the BasePicker.java constructor with this and try again?

int width = (int)(Gdx.graphics.getBackBufferWidth() * 0.8);
int height = (int)(Gdx.graphics.getBackBufferHeight() * 0.8);

fbo = new FrameBuffer(Pixmap.Format.RGBA8888, width, height, true);

You may have to tweak the scale value a bit, but this should actually work..
See this discussion on StackOverflow

Also, do you have multiple monitors?

from mundus.

justinmeister avatar justinmeister commented on May 18, 2024

So it didn't work, but I got some more clues.

Both Gdx.graphics.getBackBufferWidth() and Gdx.graphics.getBackBufferHeight() are returning 0 instead of the screen dimensions. I'm not really sure why. Just out of curiosity, I hard coded the pixel dimensions of my monitor as arguments for the frameBuffer. This is the result I got:

:editor:processResources
:editor:classes
:editor:run
[12:54][Info] Started: 16-06-28
[12:54][Debug] Disposing project current null
> Building 87% > :editor:run

It ended up getting stuck on "Building 87%" and I had to stop the process.

I do not have multiple monitors.

from mundus.

mbrlabs avatar mbrlabs commented on May 18, 2024

Ok, so hardcoding the dimensions fixed the issue.
Can you please provide these values along with the output you get when running this:

System.out.println("width: " + Gdx.graphics.getWidth());
System.out.println("height: " + Gdx.graphics.getHeight());
System.out.println("bb width: " + Gdx.graphics.getBackBufferWidth());
System.out.println("bb height: " + Gdx.graphics.getBackBufferHeight());

It's not stuck, it's running Mundus. editor:run builds and executes the project, that's because it's "stuck". Does the Mundus window not open?

from mundus.

justinmeister avatar justinmeister commented on May 18, 2024

Here is the output:

:editor:processResources
:editor:classes
:editor:run
[13:24][Info] Started: 16-06-28
width: 0
height: 0
bb width: 0
bb height: 0
width: 0
height: 0
bb width: 0
bb height: 0
[13:24][Debug] Disposing project current null
> Building 87% > :editor:run

The Mundus window doesn't open. An java executable is running but no window is shown. It makes my fan run pretty hard though.

from mundus.

mbrlabs avatar mbrlabs commented on May 18, 2024

Thanks!
Well, that's interesting...everything 0. This also explains the original issue regarding the Fbo.
Just to make sure: you are querying the dimensions after Gdx is inizialized, not inside Main, right?

from mundus.

justinmeister avatar justinmeister commented on May 18, 2024

I put the System.out.println() statements in the BasePicker constructor. I'm assuming at that point Gdx is supposed to be initialized.

from mundus.

mbrlabs avatar mbrlabs commented on May 18, 2024

Yes, that's alright. This might be a libGDX + LWJGL3 backend + mac issue.
Just one last thing: inside Main.java after the DisplayMode is fetched, do this:

System.out.println("width: " + dm.width);
System.out.println("height: " + dm.height);

A hotfix might also be to set the initial dimensions manually:

config.setWindowedMode(1200, 600);

from mundus.

justinmeister avatar justinmeister commented on May 18, 2024

So I got:

width: 1440
height: 900

in the console for the dm.width and dm.height.

Interestingly enough, hardcoding the config.setWindowedMode(1200, 600) got the Mundus window to open fine. getBackBufferWidth and getBackBufferHeight seems to be working fine now. Their outputs are now 1200, and 600.

from mundus.

mbrlabs avatar mbrlabs commented on May 18, 2024

Good, thanks for figuring that out!
I think this happens if width and height are both set to their maximums.

I just commit a fix. Can you verify that this works?

from mundus.

justinmeister avatar justinmeister commented on May 18, 2024

The latest commit does not work, I got the error:

[14:46][Error] FBO dimensions 100%: frame buffer couldn't be constructed: incomplete attachment
[14:46][Error] FBO dimensions 90%: frame buffer couldn't be constructed: incomplete attachment
[14:46][Error] FBO dimensions 100%: frame buffer couldn't be constructed: incomplete attachment
[14:46][Error] FBO dimensions 90%: frame buffer couldn't be constructed: incomplete attachment
[14:47][Debug] Disposing project current null

However, I tweaked the setWindowedMethod() and found that 0.88 for height and width was the highest without an error:

config.setWindowedMode((int) (dm.width*0.88f), (int) (dm.height*0.88f));

After that change, it worked fine.

from mundus.

mbrlabs avatar mbrlabs commented on May 18, 2024

This behaviour is really annoying. Anyway, this should be fixed now.
Thanks for the great help ;)

from mundus.

justinmeister avatar justinmeister commented on May 18, 2024

Yep, works fine now.

from mundus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.