Project

General

Profile

« Previous | Next » 

Revision 0c303a2c

Added by Leszek Koltunski about 7 years ago

Release all TREE FBOs in Distorted.onPause().

View differences:

src/main/java/org/distorted/library/Distorted.java
131 131
  public static void onPause()
132 132
    {
133 133
    DistortedSurface.onPause();
134
    DistortedNode.onPause();
134 135
    }
135 136

  
136 137
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/library/DistortedNode.java
89 89
      }
90 90
    }
91 91
 
92
///////////////////////////////////////////////////////////////////////////////////////////////////
93

  
94
  static synchronized void onPause()
95
    {
96
    NodeData data;
97

  
98
    for (HashMap.Entry<ArrayList<Long>,NodeData> entry : mMapNodeID.entrySet())
99
      {
100
      data = entry.getValue();
101

  
102
      if( data.mFBO != null )
103
        {
104
        data.mFBO.markForDeletion();
105
        data.mFBO = null;
106
        }
107
      }
108
    }
109

  
92 110
///////////////////////////////////////////////////////////////////////////////////////////////////
93 111

  
94 112
  static synchronized void onDestroy()
......
248 266
        numRenders += mChildren.get(i).renderRecursive(currTime);
249 267
        }
250 268

  
269
      if( mData.mFBO==null )
270
        {
271
        mData.mFBO = new DistortedFramebuffer(true, DistortedSurface.TYPE_TREE, mSurface.getWidth(),mSurface.getHeight());
272
        }
273

  
251 274
      mData.mFBO.setAsOutput(currTime);
252 275

  
253 276
      if( mSurface.setAsInput() )
src/main/java/org/distorted/library/DistortedOutputSurface.java
173 173
        {
174 174
        if( mBuffer1==null )
175 175
          {
176
          mBuffer1 = new DistortedFramebuffer(mDepthCreated!=DONT_CREATE, DistortedSurface.TYPE_TREE, mWidth, mHeight);
177
          mBuffer2 = new DistortedFramebuffer(false                     , DistortedSurface.TYPE_TREE, mWidth, mHeight);
176
          mBuffer1 = new DistortedFramebuffer(mDepthCreated!=DONT_CREATE, DistortedSurface.TYPE_SYST, mWidth, mHeight);
177
          mBuffer2 = new DistortedFramebuffer(false                     , DistortedSurface.TYPE_SYST, mWidth, mHeight);
178 178
          }
179 179

  
180 180
        numRenders += child.draw(time,mBuffer1);
src/main/java/org/distorted/library/DistortedSurface.java
130 130

  
131 131
  static synchronized void onDestroy()
132 132
    {
133
    Job job;
134
    Iterator<Map.Entry<Long,Job>> it = mToDoMap.entrySet().iterator();
135

  
136
    while (it.hasNext())
137
      {
138
      Map.Entry<Long,Job> entry = it.next();
139
      job = entry.getValue();
140
      if (job.surface.mType!=TYPE_SYST) it.remove();
141
      }
142

  
133
    mToDoMap.clear();
143 134
    mDoneList.clear();
144 135

  
145 136
    mToDo = true;

Also available in: Unified diff