Project

General

Profile

« Previous | Next » 

Revision ad16ed3b

Added by Leszek Koltunski about 7 years ago

Progress with Stencil App; should be working now AFAIK but doesn't.

View differences:

src/main/java/org/distorted/library/DistortedOutputSurface.java
64 64

  
65 65
  private float mClearR, mClearG, mClearB, mClearA;
66 66
  private float mClearDepth;
67
  private int mClear;
67 68

  
68 69
//private String sNew="", sOld="";
69 70

  
......
92 93
    mClearA = 0.0f;
93 94

  
94 95
    mClearDepth = 1.0f;
96
    mClear = GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT;
95 97

  
96 98
    mBuffer1 = new DistortedFramebuffer[EffectQuality.LENGTH];
97 99
    mBuffer2 = new DistortedFramebuffer[EffectQuality.LENGTH];
......
295 297
      DistortedRenderState.colorDepthOn();
296 298
      GLES30.glClearColor(mClearR, mClearG, mClearB, mClearA);
297 299
      GLES30.glClearDepthf(mClearDepth);
298
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
300
      GLES30.glClear(mClear);
299 301
      }
300 302
    }
301 303

  
......
326 328
///////////////////////////////////////////////////////////////////////////////////////////////////
327 329
/**
328 330
 * Set the (R,G,B,A) values of GLES30.glClearColor() to set up color with which to clear
329
 * this Surface before each render.
331
 * this Surface at the beginning of each frame.
330 332
 *
331 333
 * @param r the Red component. Default: 0.0f
332 334
 * @param g the Green component. Default: 0.0f
......
344 346
///////////////////////////////////////////////////////////////////////////////////////////////////
345 347
/**
346 348
 * Set the Depth value of GLES30.glClearDepthf() to set up depth with which to clear
347
 * the Depth buffer of Surface before each render.
349
 * the Depth buffer of Surface at the beginning of each frame.
348 350
 *
349 351
 * @param d the Depth. Default: 1.0f
350 352
 */
......
353 355
    mClearDepth = d;
354 356
    }
355 357

  
358
///////////////////////////////////////////////////////////////////////////////////////////////////
359
/**
360
 * Which buffers to Clear at the beginning of each frame?
361
 * <p>
362
 * Valid values: 0, or bitwise OR of one or more values from the set GL_COLOR_BUFFER_BIT,
363
 *               GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT.
364
 * Default: GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT.
365
 *
366
 * @param mask bitwise OR of BUFFER_BITs to clear.
367
 */
368
  public void glClear(int mask)
369
    {
370
    mClear = mask;
371
    }
372

  
356 373
///////////////////////////////////////////////////////////////////////////////////////////////////
357 374
/**
358 375
 * Create new Projection matrix.

Also available in: Unified diff