fbo is now properly sized

This commit is contained in:
Harrison Deng 2017-07-19 23:31:05 -05:00
parent 942cd9f102
commit 60dacb6d4c
2 changed files with 11 additions and 27 deletions

View File

@ -119,7 +119,7 @@ active: false
- Tint -
colorsCount: 3
colors0: 0.15294118
colors1: 0.85882354
colors1: 0.8627451
colors2: 1.0
timelineCount: 1
timeline0: 0.0
@ -147,7 +147,7 @@ timeline5: 1.0
attached: false
continuous: true
aligned: false
additive: true
additive: false
behind: false
premultipliedAlpha: false
- Image Path -

View File

@ -128,23 +128,21 @@ public class GamePlayArea extends Stage {
Gdx.gl.glClearColor(0f, 0f, 0f, 0f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
//
getBatch().setBlendFunction(-1, -1);
Gdx.gl20.glBlendFuncSeparate(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA,GL20.GL_ONE, GL20.GL_DST_ALPHA);
getBatch().setShader(null);
// resizeBatch(fboSize, fboSize);
// resizeBatch(Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT);
updateBatch();
getBatch().begin();
getRoot().draw(getBatch(), 1f);
getBatch().flush();
// use -1 to ignore.. somebody should fix this in LibGDX :\
getBatch().setBlendFunction(-1, -1);
// setup our alpha blending to avoid blending twice
Gdx.gl20.glBlendFuncSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_ONE, GL20.GL_ONE);
super.draw();
blurTarget.end(getViewport().getScreenX(), getViewport().getScreenY(), getViewport().getScreenWidth(), getViewport().getScreenHeight());
// resizeBatch(Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT);
updateBatch();
getBatch().begin();
// getBatch().setShader(glowShader);
getBatch().draw(fboRegion, 0f, 0f, Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT);
getBatch().setShader(null);
getBatch().end();
@ -154,20 +152,6 @@ public class GamePlayArea extends Stage {
}
}
private void updateBatch() {
Camera camera = getViewport().getCamera();
camera.update();
Batch batch = getBatch();
batch.setProjectionMatrix(camera.combined);
}
void resizeBatch(int width, int height) {
((OrthographicCamera) getCamera()).setToOrtho(false, width, height);
getBatch().setProjectionMatrix(getCamera().combined);
// getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
}
@Override
public void act(float delta) {
MapWindowData mwd;