Revision 6bce98fc
Added by Leszek Koltunski about 5 years ago
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) |
Also available in: Unified diff
Minor.