Project

General

Profile

« Previous | Next » 

Revision da99dd30

Added by Leszek Koltunski almost 8 years ago

Clean up DFramebuffer's API

View differences:

src/main/java/org/distorted/library/DistortedFramebuffer.java
48 48
  private static boolean mListMarked = false;
49 49
  private static LinkedList<DistortedFramebuffer> mList = new LinkedList<>();
50 50

  
51
  private float mX, mY, mFOV;
52

  
53
  int[] texIds = new int[1];
54
  int[] fboIds = new int[1];
51
  private int[] texIds = new int[1];
52
  private int[] fboIds = new int[1];
55 53

  
56 54
  private boolean mMarked;
57 55

  
56
  // Projection stuff
57
  private float mX, mY, mFOV;
58 58
  int mWidth,mHeight,mDepth;
59 59
  float mDistance;
60 60
  float[] mProjectionMatrix;
......
124 124
      texIds[0] = TEXTURE_NOT_CREATED_YET;
125 125
    }
126 126

  
127
///////////////////////////////////////////////////////////////////////////////////////////////////
128

  
129
  void setAsOutput()
130
    {
131
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, fboIds[0]);
132
    }
133

  
134
///////////////////////////////////////////////////////////////////////////////////////////////////
135

  
136
  void setAsInput()
137
    {
138
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texIds[0]);
139
    }
140

  
127 141
///////////////////////////////////////////////////////////////////////////////////////////////////
128 142

  
129 143
  private void createProjection()
src/main/java/org/distorted/library/DistortedTree.java
216 216

  
217 217
      if( mData.numRendered==0 )
218 218
        {
219
        GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mData.mDF.fboIds[0]);
219
        mData.mDF.setAsOutput();
220 220

  
221 221
        GLES20.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
222 222
        GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
......
239 239
      mData.numRendered++;
240 240
      mData.numRendered %= mData.numPointingNodes;
241 241

  
242
      GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, df.fboIds[0]);
243
      GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mData.mDF.texIds[0]);
242
      df.setAsOutput();
243
      mData.mDF.setAsInput();
244 244
      }
245 245

  
246 246
    mEffects.drawPriv(mTexture.mHalfX, mTexture.mHalfY, mGrid, df, currTime);

Also available in: Unified diff