• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Main repository of MikuMikuStudio


Commit MetaInfo

Revision07a0ef14e6171c9f1a50026dd26e9cf364e38a50 (tree)
Zeit2014-02-19 14:40:56
Autorkobayasi <kobayasi@pscn...>
Commiterkobayasi

Log Message

Support setFrameBuffer and depth texture on iOS

Ändern Zusammenfassung

Diff

--- a/gdx/src/main/java/com/jme3/renderer/gdx/GdxRenderer.java
+++ b/gdx/src/main/java/com/jme3/renderer/gdx/GdxRenderer.java
@@ -103,7 +103,7 @@ public final class GdxRenderer implements Renderer {
103103 private boolean verboseLogging = false;
104104 private boolean useVBO = true;
105105 public boolean adreno_finish_bug = false;
106-
106+ private int mainFrameBuffer = -1;
107107 public GdxRenderer() {
108108 }
109109
@@ -411,6 +411,12 @@ public final class GdxRenderer implements Renderer {
411411 adreno_finish_bug = true;
412412 }
413413 logger.log(Level.INFO, "Caps: {0}", caps);
414+
415+ // Get main framebuffer id because main framebuffer is not 0 on iOS.
416+ if (mainFrameBuffer == -1) {
417+ Gdx.gl20.glGetIntegerv(GL20.GL_FRAMEBUFFER_BINDING, intBuf16);
418+ mainFrameBuffer = intBuf16.get(0);
419+ }
414420 }
415421
416422 /**
@@ -1712,13 +1718,13 @@ public final class GdxRenderer implements Renderer {
17121718
17131719 if (fb == null) {
17141720 // unbind any fbos
1715- if (context.boundFBO != 0) {
1716- Gdx.gl20.glBindFramebuffer(GL20.GL_FRAMEBUFFER, 0);
1721+ if (context.boundFBO != mainFrameBuffer) {
1722+ Gdx.gl20.glBindFramebuffer(GL20.GL_FRAMEBUFFER, mainFrameBuffer);
17171723 // RendererUtil.checkGLError();
17181724
17191725 statistics.onFrameBufferUse(null, true);
17201726
1721- context.boundFBO = 0;
1727+ context.boundFBO = mainFrameBuffer;
17221728 }
17231729
17241730 /*
--- a/gdx/src/main/java/com/jme3/renderer/gdx/TextureUtilGdx.java
+++ b/gdx/src/main/java/com/jme3/renderer/gdx/TextureUtilGdx.java
@@ -406,13 +406,13 @@ public class TextureUtilGdx {
406406 format = GL20.GL_COMPRESSED_TEXTURE_FORMATS;
407407 dataType = GL20.GL_UNSIGNED_BYTE;
408408 case Depth:
409- format = GL20.GL_DEPTH_COMPONENT;
410- dataType = GL20.GL_UNSIGNED_BYTE;
411- break;
409+// format = GL20.GL_DEPTH_COMPONENT;
410+// dataType = GL20.GL_UNSIGNED_BYTE;
411+// break;
412412 case Depth16:
413413 format = GL20.GL_DEPTH_COMPONENT;
414- internalFormat = GL20.GL_DEPTH_COMPONENT16;
415- dataType = GL20.GL_UNSIGNED_BYTE;
414+ internalFormat = GL20.GL_DEPTH_COMPONENT;
415+ dataType = GL20.GL_UNSIGNED_SHORT;
416416 break;
417417 case Depth24:
418418 case Depth32: