0
votes

I am trying to make a simple 3D camera in LibGDX with a window at a resolution of 100 x 100 but it keeps crashing (it works with the standard window size), how do i set the LibGDX window size? here is my code:

@Override
public void create () {
    cam = new PerspectiveCamera(70,100,100);
    cam.lookAt(0f,0f,0f);
    cam.near = 0.1f;
    cam.far = 64f;
    Gdx.graphics.setWindowedMode(100, 100);

    player = new Player(cam);
    player.position = new Vector3(0, 16f, 0);
    player.updateCameraPosition();

    modelBuilder = new ModelBuilder();
    modelBatch = new ModelBatch();
    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight,0.75f,0.75f,0.75f,0.75f));

    inputs = new Inputs();
    world = new World();

    world.blockTypes = world.setupBlockTypes();
    world.blockTypeModels = world.setupBlockTypeModels(world.blockTypes);

    world.generate(1,1,noise,16);

    Gdx.input.setInputProcessor(inputs);
}
1
Crashing how? Are you getting any error message? Is there an exception thrown, if so, from what line? - bornander
the error message is: execution failed for task desktop:DesktopLauncher.main() with exit value 134, but nothing specific, that's why i'm so puzzled - Babuka Barabuka
What platform are you on, are you on Linux? - bornander
I am on macOSX, but not on the M1 version. - Babuka Barabuka
I had JDK 13 installed, but i tried version 11 and it worked, thanks! - Babuka Barabuka

1 Answers

1
votes

Changing the java version to java 11 from java 13 worked.