Project

General

Profile

« Previous | Next » 

Revision 6bce98fc

Added by Leszek Koltunski over 5 years ago

Minor.

View differences:

src/main/java/org/distorted/library/main/DistortedEffects.java
529 529
    }
530 530

  
531 531
///////////////////////////////////////////////////////////////////////////////////////////////////
532
/**
533
 * Only for use by the library itself.
534
 *
535
 * @y.exclude
536
 */
537
  public static void blitPriv(DistortedOutputSurface surface)
532

  
533
  static void blitPriv(DistortedOutputSurface surface)
538 534
    {
539 535
    mBlitProgram.useProgram();
540 536

  
src/main/java/org/distorted/library/main/DistortedRenderState.java
425 425
      }
426 426
    }
427 427

  
428
///////////////////////////////////////////////////////////////////////////////////////////////////
429

  
430
  static void disableStencil()
431
    {
432
    sState.stencilTest = cState.stencilTest;
433

  
434
    if (cState.stencilTest != 0)
435
      {
436
      cState.stencilTest = 0;
437
      GLES31.glDisable(GLES31.GL_STENCIL_TEST);
438
      }
439

  
440
    sState.stencilFuncFunc = cState.stencilFuncFunc;
441
    sState.stencilFuncRef  = cState.stencilFuncRef;
442
    sState.stencilFuncMask = cState.stencilFuncMask;
443

  
444
    if( cState.stencilFuncFunc!=GLES31.GL_EQUAL || cState.stencilFuncRef!=1 || cState.stencilFuncMask!=STENCIL_MASK )
445
      {
446
      cState.stencilFuncFunc = GLES31.GL_EQUAL;
447
      cState.stencilFuncRef  = 1;
448
      cState.stencilFuncMask = STENCIL_MASK;
449
      GLES31.glStencilFunc(cState.stencilFuncFunc,cState.stencilFuncRef,cState.stencilFuncMask);
450
      }
451

  
452
    sState.stencilMask = cState.stencilMask;
453

  
454
    if( cState.stencilMask!= 0x00 )
455
      {
456
      cState.stencilMask = 0x00;
457
      GLES31.glStencilMask(cState.stencilMask);
458
      }
459
    }
460

  
461
///////////////////////////////////////////////////////////////////////////////////////////////////
462

  
463
  static void restoreStencil()
464
    {
465
    if (sState.stencilTest != cState.stencilTest)
466
      {
467
      cState.stencilTest = sState.stencilTest;
468

  
469
      if (cState.stencilTest == 0)
470
        {
471
        GLES31.glDisable(GLES31.GL_STENCIL_TEST);
472
        }
473
      else
474
        {
475
        GLES31.glEnable(GLES31.GL_STENCIL_TEST);
476
        }
477
      }
478
    if( sState.stencilFuncFunc!=cState.stencilFuncFunc || sState.stencilFuncRef!=cState.stencilFuncRef || sState.stencilFuncMask!=cState.stencilFuncMask )
479
      {
480
      cState.stencilFuncFunc = sState.stencilFuncFunc;
481
      cState.stencilFuncRef  = sState.stencilFuncRef ;
482
      cState.stencilFuncMask = sState.stencilFuncMask;
483
      GLES31.glStencilFunc(cState.stencilFuncFunc,cState.stencilFuncRef,cState.stencilFuncMask);
484
      }
485
    if( sState.stencilMask!=cState.stencilMask )
486
      {
487
      cState.stencilMask = sState.stencilMask;
488
      GLES31.glStencilMask(cState.stencilMask);
489
      }
490
    }
491

  
492 428
///////////////////////////////////////////////////////////////////////////////////////////////////
493 429

  
494 430
  static void setUpStencilMark(boolean color)
src/main/java/org/distorted/library/main/DistortedScreen.java
104 104
      mPaint.setColor(0xffffffff);
105 105
      fpsCanvas.drawRect(0, 0, FPS_W, FPS_H, mPaint);
106 106
      mPaint.setColor(0xff000000);
107
      fpsCanvas.drawText(fpsString, FPS_W/2, 0.75f*FPS_H, mPaint);
107
      fpsCanvas.drawText(fpsString, 0.5f*FPS_W, 0.75f*FPS_H, mPaint);
108 108
      fpsTexture.setTexture(fpsBitmap);
109 109

  
110 110
      mMoveVector.set2(mHeight-FPS_H-5);

Also available in: Unified diff