box2d - Strange screen size on LibGDX DisplayMode -


i facing problems libgdx , box2d because of camera setup.

while investigating, found that:

    gdx.graphics.getwidth() == 320     gdx.graphics.getheight() == 526 

even though set stage , orthographiccamera 1080/1920 or 270/480 (i playing values).

then followed documentation , looks value has nothing stage neither camera. after that, checked got 1 displaymode available:

    displaymode[] dms = gdx.graphics.getdisplaymodes();     (int = 0; < dms.length; i++) {         log.d("myapp", "dms > " + dms[i].tostring());     } 

results in:

    dms > 320x526, bpp: 0, hz: 0 

because of that, call setdisplaymode being ignored:

    gdx.graphics.setdisplaymode(screen_width, screen_height, true); 

it changes nothing.

i suspecting might problem, how can change it?

edit: testing in nexus 5.

gdx.graphics.getwidth() , gdx.graphics.getheight() return screen dimensions. on desktop size of window (which can resize), on android cannot change them. should adapt camera viewport size screen size instead.


Comments