Project

General

Profile

« Previous | Next » 

Revision fbe9542f

Added by Leszek Koltunski over 5 years ago

Correct the same bug for DistortedTextures and DistortedFramebuffers: only mark them for creation when we actually have everything ready, i.e. as the last statement in the constructor.

View differences:

src/main/java/org/distorted/library/main/DistortedFramebuffer.java
214 214
    }
215 215

  
216 216
///////////////////////////////////////////////////////////////////////////////////////////////////
217
// create SYSTEM or TREE framebuffers (those are just like normal FBOs, just hold information
218
// that they were autocreated only for the Library's internal purposes (SYSTEM) or for using
219
// inside a Tree of DistortedNodes (TREE)
220
// SYSTEM surfaces do not get removed in onDestroy().
217
// create a multi-framebuffer (1 object containing multiple FBOs)
221 218

  
222
  DistortedFramebuffer(int numcolors, int depthStencil, int type, int width, int height)
219
  DistortedFramebuffer(int numfbos, int numcolors, int depthStencil, int type, int width, int height)
223 220
    {
224
    super(width,height,NOT_CREATED_YET,1,numcolors,depthStencil,NOT_CREATED_YET, type);
221
    super(width,height,NOT_CREATED_YET,numfbos,numcolors,depthStencil,NOT_CREATED_YET, type);
222
    markForCreation();
225 223
    }
226 224

  
227 225
///////////////////////////////////////////////////////////////////////////////////////////////////
228
// create a multi-framebuffer (1 object containing multiple FBOs)
226
// create SYSTEM or TREE framebuffers (those are just like normal FBOs, just hold information
227
// that they were autocreated only for the Library's internal purposes (SYSTEM) or for using
228
// inside a Tree of DistortedNodes (TREE)
229
// SYSTEM surfaces do not get removed in onDestroy().
229 230

  
230
  DistortedFramebuffer(int numfbos, int numcolors, int depthStencil, int type, int width, int height)
231
  DistortedFramebuffer(int numcolors, int depthStencil, int type, int width, int height)
231 232
    {
232
    super(width,height,NOT_CREATED_YET,numfbos,numcolors,depthStencil,NOT_CREATED_YET, type);
233
    this(1,numcolors,depthStencil,type,width,height);
233 234
    }
234 235

  
235 236
///////////////////////////////////////////////////////////////////////////////////////////////////
......
247 248
  @SuppressWarnings("unused")
248 249
  public DistortedFramebuffer(int width, int height, int numcolors, int depthStencil)
249 250
    {
250
    super(width,height,NOT_CREATED_YET,1,numcolors,depthStencil,NOT_CREATED_YET,TYPE_USER);
251
    this(1,numcolors,depthStencil,TYPE_USER,width,height);
251 252
    }
252 253

  
253 254
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/library/main/DistortedSurface.java
43 43
    {
44 44
    super(type);
45 45

  
46
    if( create!=DONT_CREATE ) markForCreation();
47

  
48 46
    mNumFBOs      = numfbos;
49 47
    mNumColors    = numcolors;
50 48
    mWidth        = width ;
src/main/java/org/distorted/library/main/DistortedTexture.java
117 117
    {
118 118
    super(width,height,NOT_CREATED_YET,1,1,type);
119 119
    mBmp= null;
120
    markForCreation();
120 121
    }
121 122

  
122 123
///////////////////////////////////////////////////////////////////////////////////////////////////
......
127 128
 */
128 129
  public DistortedTexture(int width, int height)
129 130
    {
130
    super(width,height,NOT_CREATED_YET,1,1,TYPE_USER);
131
    mBmp= null;
131
    this(width,height,TYPE_USER);
132 132
    }
133 133

  
134 134
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff