Project

General

Profile

« Previous | Next » 

Revision 02de77c9

Added by Leszek Koltunski over 7 years ago

Progress with multi-program rendering.

View differences:

src/main/java/org/distorted/library/DistortedFramebuffer.java
154 154
    mMarked = false;
155 155
    }
156 156

  
157
///////////////////////////////////////////////////////////////////////////////////////////////////
158

  
159
  void reset()
160
    {
161
    if( colorIds[0]!=DONT_CREATE )
162
      colorIds[0] = NOT_CREATED_YET;
163

  
164
    if( mDepthWanted ) depthIds[0] = NOT_CREATED_YET;
165
    }
166

  
167 157
///////////////////////////////////////////////////////////////////////////////////////////////////
168 158

  
169 159
  void setAsOutput()
......
228 218

  
229 219
  static synchronized void onDestroy()
230 220
    {
231
    // There are issues with this. Namely, if one
232
    // 1. creates a DObjectTree (somewhere else than onSurfaceCreated of constructor so it does not get re-created on re-launch)
233
    // 2. exits the app (here mList would be cleared)
234
    // 3. re-launches the app
235
    // 4. deletes some nodes
236
    // then the underlying Framebuffers will never be deleted!
237

  
238
    mListMarked = false;
239
    mList.clear();
221
    for( DistortedFramebuffer fbo : mList)
222
      {
223
      if( fbo.colorIds[0]!=DONT_CREATE ) fbo.colorIds[0] = NOT_CREATED_YET;
224
      if( fbo.mDepthWanted             ) fbo.depthIds[0] = NOT_CREATED_YET;
225
      }
240 226
    }
241 227

  
242 228
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff