Project

General

Profile

Download (23.7 KB) Statistics
| Branch: | Revision:

library / src / main / java / org / distorted / library / main / DistortedNode.java @ 9ecac8cd

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2016 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Distorted.                                                               //
5
//                                                                                               //
6
// Distorted is free software: you can redistribute it and/or modify                             //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Distorted is distributed in the hope that it will be useful,                                  //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19

    
20
package org.distorted.library.main;
21

    
22
import android.opengl.GLES31;
23

    
24
import org.distorted.library.mesh.MeshBase;
25

    
26
import java.util.ArrayList;
27
import java.util.Collections;
28

    
29
///////////////////////////////////////////////////////////////////////////////////////////////////
30
/**
31
 * Class which represents a Node in a Tree of (InputSurface,Mesh,Effects) triplets.
32
 * <p>
33
 * Having organized such sets into a Tree, we can then render any Node to any OutputSurface.
34
 * That recursively renders the set held in the Node and all its children.
35
 * <p>
36
 * The class takes special care to only render identical sub-trees once. Each Node holds a reference
37
 * to sub-class 'NodeData'. Two identical sub-trees attached at different points of the main tree
38
 * will point to the same NodeData; only the first of this is rendered (mData.numRender!).
39
 */
40
public class DistortedNode implements InternalChildrenList.Parent
41
  {
42
  private MeshBase mMesh;
43
  private DistortedEffects mEffects;
44
  private InternalSurface mSurface;
45
  private InternalRenderState mState;
46
  private InternalNodeData mData;
47
  private InternalChildrenList mChildren;
48
  private InternalChildrenList.Parent mParent;
49

    
50
  private int mFboW, mFboH, mFboDepthStencil;
51
  private boolean mRenderWayOIT;
52

    
53
///////////////////////////////////////////////////////////////////////////////////////////////////
54

    
55
  public void markForDeletion()
56
    {
57
    if( mData.removeData() )
58
      {
59
      mData.mFBO.markForDeletion();
60
      mData.mFBO = null;
61
      }
62
    }
63

    
64
///////////////////////////////////////////////////////////////////////////////////////////////////
65
// [3] --> the postprocessing queue. See EffectType.
66

    
67
  long getBucket()
68
    {
69
    return mEffects.getQueues()[3].getID();
70
    }
71

    
72
///////////////////////////////////////////////////////////////////////////////////////////////////
73

    
74
  private ArrayList<Long> generateIDList()
75
    {
76
    ArrayList<Long> ret = new ArrayList<>();
77
    int numChildren = mChildren.getNumChildren();
78

    
79
    if( numChildren==0 )
80
      {
81
      // add a negative number so this leaf never gets confused with a internal node
82
      // with a single child that happens to have ID identical to some leaf's Effects ID.
83
      ret.add(-mEffects.getID());
84
      }
85
    else
86
      {
87
      DistortedNode node;
88
   
89
      for(int i=0; i<numChildren; i++)
90
        {
91
        node = mChildren.getChild(i);
92
        ret.add(node.mData.ID);
93
        }
94

    
95
      // A bit questionable decision here - we are sorting the children IDs, which means
96
      // that order in which we draw the children is going to be undefined (well, this is not
97
      // strictly speaking true - when rendering, if no postprocessing and isomorphism are
98
      // involved, we *DO* render the children in order they were added; if however there
99
      // are two internal nodes with the same list of identical children, just added in a
100
      // different order each time, then we consider them isomorphic, i.e. identical and only
101
      // render the first one. If then two children of such 'pseudo-isomorphic' nodes are at
102
      // exactly the same Z-height this might result in some unexpected sights).
103
      //
104
      // Reason: with the children being sorted by postprocessing buckets, the order is
105
      // undefined anyway (although only when postprocessing is applied).
106
      //
107
      // See the consequences in the 'Olympic' app - remove a few leaves and add them back in
108
      // different order. You will see the number of renders go back to the original 15.
109
      Collections.sort(ret);
110
      }
111

    
112
    ret.add( 0, mSurface.getID() );
113

    
114
    return ret;
115
    }
116

    
117
///////////////////////////////////////////////////////////////////////////////////////////////////
118
/**
119
 * This is not really part of the public API. Has to be public only because it is a part of the
120
 * InternalChildrenList.Parent interface.
121
 *
122
 * @y.exclude
123
 */
124
  public void adjustIsomorphism()
125
    {
126
    InternalNodeData newData = InternalNodeData.returnData(generateIDList());
127
    boolean deleteOldFBO = mData.removeData();
128
    boolean createNewFBO = (mChildren.getNumChildren()>0 && newData.mFBO==null);
129

    
130
    if( deleteOldFBO && createNewFBO )
131
      {
132
      newData.mFBO = mData.mFBO;
133
      }
134
    else if( deleteOldFBO )
135
      {
136
      mData.mFBO.markForDeletion();
137
      mData.mFBO = null;
138
      }
139
    else if( createNewFBO )
140
      {
141
      newData.mFBO = allocateNewFBO();
142
      }
143

    
144
    mData = newData;
145

    
146
    if( mParent!=null ) mParent.adjustIsomorphism();
147
    }
148

    
149
///////////////////////////////////////////////////////////////////////////////////////////////////
150
// return the total number of render calls issued
151

    
152
  int drawNoBlend(long currTime, InternalOutputSurface surface)
153
    {
154
    InternalSurface input = getSurface();
155

    
156
    if( input.setAsInput() )
157
      {
158
      mState.apply();
159
      GLES31.glDisable(GLES31.GL_BLEND);
160
      DistortedLibrary.drawPriv(mEffects, mMesh, surface, currTime);
161
      GLES31.glEnable(GLES31.GL_BLEND);
162
      return 1;
163
      }
164

    
165
    return 0;
166
    }
167

    
168
///////////////////////////////////////////////////////////////////////////////////////////////////
169
// Use the Order Independent Transparency method to draw a non-postprocessed child.
170

    
171
  int drawOIT(long currTime, InternalOutputSurface surface)
172
    {
173
    InternalSurface input = getSurface();
174

    
175
    if( input.setAsInput() )
176
      {
177
      mState.apply();
178
      DistortedLibrary.drawPrivOIT(mEffects, mMesh, surface, currTime);
179
      return 1;
180
      }
181

    
182
    return 0;
183
    }
184

    
185
///////////////////////////////////////////////////////////////////////////////////////////////////
186
// return the total number of render calls issued
187

    
188
  int draw(long currTime, InternalOutputSurface surface)
189
    {
190
    InternalSurface input = getSurface();
191

    
192
    if( input.setAsInput() )
193
      {
194
      mState.apply();
195
      DistortedLibrary.drawPriv(mEffects, mMesh, surface, currTime);
196
      return 1;
197
      }
198

    
199
    return 0;
200
    }
201

    
202
///////////////////////////////////////////////////////////////////////////////////////////////////
203
// return the total number of render calls issued
204

    
205
  int renderRecursive(long currTime)
206
    {
207
    int numRenders = 0;
208
    int numChildren = mChildren.getNumChildren();
209

    
210
    if( numChildren>0 && mData.notRenderedYetAtThisTime(currTime) )
211
      {
212
      DistortedNode node;
213
      long oldBucket=0, newBucket;
214

    
215
      for (int i=0; i<numChildren; i++)
216
        {
217
        node = mChildren.getChild(i);
218
        newBucket = node.getBucket();
219
        numRenders += node.renderRecursive(currTime);
220
        if( newBucket<oldBucket ) mChildren.rearrangeByBuckets(i,newBucket);
221
        else oldBucket=newBucket;
222
        }
223

    
224
      if( mData.mFBO==null ) mData.mFBO = allocateNewFBO();
225
      mData.mFBO.setAsOutput(currTime);
226

    
227
      if( mSurface.setAsInput() )
228
        {
229
        numRenders++;
230
        DistortedLibrary.blitPriv(mData.mFBO);
231
        }
232

    
233
      numRenders += mData.mFBO.renderChildren(currTime,numChildren,mChildren,0, mRenderWayOIT);
234
      }
235

    
236
    return numRenders;
237
    }
238

    
239
///////////////////////////////////////////////////////////////////////////////////////////////////
240

    
241
  private DistortedFramebuffer allocateNewFBO()
242
    {
243
    int width, height;
244

    
245
    if( mFboW>0 && mFboH>0 )
246
      {
247
      width = mFboW;
248
      height= mFboH;
249
      }
250
    else
251
      {
252
      if( mSurface instanceof DistortedFramebuffer )
253
        {
254
        DistortedFramebuffer fbo = (DistortedFramebuffer)mSurface;
255
        width = fbo.mWidth;
256
        height= fbo.mHeight;
257
        }
258
      else
259
        {
260
        width = 100;
261
        height= 100;
262
        }
263
      }
264

    
265
    return new DistortedFramebuffer(1,mFboDepthStencil, InternalSurface.TYPE_TREE, width, height);
266
    }
267

    
268
///////////////////////////////////////////////////////////////////////////////////////////////////
269

    
270
  void setParent(InternalChildrenList.Parent parent)
271
    {
272
    mParent = parent;
273
    }
274

    
275
///////////////////////////////////////////////////////////////////////////////////////////////////
276
// PUBLIC API
277
///////////////////////////////////////////////////////////////////////////////////////////////////
278
/**
279
 * Constructs new Node.
280
 *     
281
 * @param surface InputSurface to put into the new Node.
282
 * @param effects DistortedEffects to put into the new Node.
283
 * @param mesh MeshBase to put into the new Node.
284
 */
285
  public DistortedNode(InternalSurface surface, DistortedEffects effects, MeshBase mesh)
286
    {
287
    mSurface       = surface;
288
    mEffects       = effects;
289
    mMesh          = mesh;
290
    mState         = new InternalRenderState();
291
    mChildren      = new InternalChildrenList(this);
292
    mParent        = null;
293
    mRenderWayOIT  = false;
294

    
295
    mFboW            = 0;  // i.e. take this from
296
    mFboH            = 0;  // mEffects's stretch{X,Y}
297
    mFboDepthStencil = DistortedFramebuffer.DEPTH_NO_STENCIL;
298

    
299
    mData = InternalNodeData.returnData(generateIDList());
300
    }
301

    
302
///////////////////////////////////////////////////////////////////////////////////////////////////  
303
/**
304
 * Copy-constructs new Node from another Node.
305
 *     
306
 * @param node The DistortedNode to copy data from.
307
 * @param flags bit field composed of a subset of the following:
308
 *        {@link DistortedLibrary#CLONE_SURFACE},  {@link DistortedLibrary#CLONE_MATRIX}, {@link DistortedLibrary#CLONE_VERTEX},
309
 *        {@link DistortedLibrary#CLONE_FRAGMENT} and {@link DistortedLibrary#CLONE_CHILDREN}.
310
 *        For example flags = CLONE_SURFACE | CLONE_CHILDREN.
311
 */
312
  public DistortedNode(DistortedNode node, int flags)
313
    {
314
    mEffects      = new DistortedEffects(node.mEffects,flags);
315
    mMesh         = node.mMesh;
316
    mState        = new InternalRenderState();
317
    mParent       = null;
318
    mRenderWayOIT = false;
319

    
320
    mFboW            = node.mFboW;
321
    mFboH            = node.mFboH;
322
    mFboDepthStencil = node.mFboDepthStencil;
323

    
324
    if( (flags & DistortedLibrary.CLONE_SURFACE) != 0 )
325
      {
326
      mSurface = node.mSurface;
327
      }
328
    else
329
      {
330
      if( node.mSurface instanceof DistortedTexture )
331
        {
332
        mSurface = new DistortedTexture(InternalSurface.TYPE_TREE);
333
        }
334
      else if( node.mSurface instanceof DistortedFramebuffer )
335
        {
336
        DistortedFramebuffer fbo = (DistortedFramebuffer)node.mSurface;
337

    
338
        int w = fbo.getWidth();
339
        int h = fbo.getHeight();
340
        int depthStencil = DistortedFramebuffer.NO_DEPTH_NO_STENCIL;
341

    
342
        if( fbo.hasDepth() )
343
          {
344
          boolean hasStencil = fbo.hasStencil();
345
          depthStencil = (hasStencil ? DistortedFramebuffer.BOTH_DEPTH_STENCIL:DistortedFramebuffer.DEPTH_NO_STENCIL);
346
          }
347

    
348
        mSurface = new DistortedFramebuffer(1,depthStencil, InternalSurface.TYPE_TREE,w,h);
349
        }
350
      }
351

    
352
    if( (flags & DistortedLibrary.CLONE_CHILDREN) != 0 )
353
      {
354
      mChildren = node.mChildren;
355
      }
356
    else
357
      {
358
      mChildren = new InternalChildrenList(this);
359
      }
360

    
361
    mData = InternalNodeData.returnData(generateIDList());
362
    }
363

    
364
///////////////////////////////////////////////////////////////////////////////////////////////////
365
  /**
366
   * When rendering this Node, should we use the Order Independent Transparency render more?
367
   * <p>
368
   * There are two modes of rendering: the fast 'normal' way, which however renders transparent
369
   * fragments in different ways depending on which fragments get rendered first, or the slower
370
   * 'oit' way, which renders transparent fragments correctly regardless of their order.
371
   *
372
   * @param oit True if we want to render more slowly, but in a way which accounts for transparency.
373
   */
374
  public void setOrderIndependentTransparency(boolean oit)
375
    {
376
    mRenderWayOIT = oit;
377
    }
378

    
379
///////////////////////////////////////////////////////////////////////////////////////////////////
380
  /**
381
   * When rendering this Node, should we use the Order Independent Transparency render more?
382
   * <p>
383
   * There are two modes of rendering: the fast 'normal' way, which however renders transparent
384
   * fragments in different ways depending on which fragments get rendered first, or the slower
385
   * 'oit' way, which renders transparent fragments correctly regardless of their order.
386
   *
387
   * @param oit True if we want to render more slowly, but in a way which accounts for transparency.
388
   * @param initialSize Initial number of transparent fragments we expect, in screenfulls.
389
   *                    I.e '1.0' means 'the scene we are going to render contains dialog_about 1 screen
390
   *                    worth of transparent fragments'. Valid values: 0.0 &lt; initialSize &lt; 10.0
391
   *                    Even if you get this wrong, the library will detect that there are more
392
   *                    transparent fragments than it has space for and readjust its internal buffers,
393
   *                    but only after a few frames during which one will probably see missing objects.
394
   */
395
  public void setOrderIndependentTransparency(boolean oit, float initialSize)
396
    {
397
    mRenderWayOIT = oit;
398

    
399
    if( initialSize>0.0f && initialSize<10.0f )
400
      DistortedLibrary.setSSBOSize(initialSize);
401
    }
402

    
403
///////////////////////////////////////////////////////////////////////////////////////////////////
404
/**
405
 * Adds a new child to the last position in the list of our Node's children.
406
 * <p>
407
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
408
 * InternalMaster (by calling doWork())
409
 *
410
 * @param node The new Node to add.
411
 */
412
  public void attach(DistortedNode node)
413
    {
414
    mChildren.attach(node);
415
    }
416

    
417
///////////////////////////////////////////////////////////////////////////////////////////////////
418
/**
419
 * Adds a new child to the last position in the list of our Node's children.
420
 * <p>
421
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
422
 * InternalMaster (by calling doWork())
423
 *
424
 * @param surface InputSurface to initialize our child Node with.
425
 * @param effects DistortedEffects to initialize our child Node with.
426
 * @param mesh MeshBase to initialize our child Node with.
427
 * @return the newly constructed child Node, or null if we couldn't allocate resources.
428
 */
429
  public DistortedNode attach(InternalSurface surface, DistortedEffects effects, MeshBase mesh)
430
    {
431
    return mChildren.attach(surface,effects,mesh);
432
    }
433

    
434
///////////////////////////////////////////////////////////////////////////////////////////////////
435
/**
436
 * Removes the first occurrence of a specified child from the list of children of our Node.
437
 * <p>
438
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
439
 * InternalMaster (by calling doWork())
440
 *
441
 * @param node The Node to remove.
442
 */
443
  public void detach(DistortedNode node)
444
    {
445
    mChildren.detach(node);
446
    }
447

    
448
///////////////////////////////////////////////////////////////////////////////////////////////////
449
/**
450
 * Removes the first occurrence of a specified child from the list of children of our Node.
451
 * <p>
452
 * A bit questionable method as there can be many different Nodes attached as children, some
453
 * of them having the same Effects but - for instance - different Mesh. Use with care.
454
 * <p>
455
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
456
 * InternalMaster (by calling doWork())
457
 *
458
 * @param effects DistortedEffects to remove.
459
 */
460
  public void detach(DistortedEffects effects)
461
    {
462
    mChildren.detach(effects);
463
    }
464

    
465
///////////////////////////////////////////////////////////////////////////////////////////////////
466
/**
467
 * Removes all children Nodes.
468
 * <p>
469
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
470
 * InternalMaster (by calling doWork())
471
 */
472
  public void detachAll()
473
    {
474
    mChildren.detachAll();
475
    }
476

    
477
///////////////////////////////////////////////////////////////////////////////////////////////////
478
/**
479
 * Returns the DistortedEffects object that's in the Node.
480
 * 
481
 * @return The DistortedEffects contained in the Node.
482
 */
483
  public DistortedEffects getEffects()
484
    {
485
    return mEffects;
486
    }
487

    
488
///////////////////////////////////////////////////////////////////////////////////////////////////
489
  /**
490
   * Returns the surface this object gets rendered to.
491
   *
492
   * @return The InternalSurface contained in the Node (if a leaf), or the FBO (if an internal Node)
493
   */
494
  public InternalSurface getSurface()
495
    {
496
    return mChildren.getNumChildren()==0 ? mSurface : mData.mFBO;
497
    }
498

    
499
///////////////////////////////////////////////////////////////////////////////////////////////////
500
/**
501
 * Returns the Mesh object that's in the Node.
502
 *
503
 * @return Mesh contained in the Node.
504
 */
505
  public MeshBase getMesh()
506
    {
507
    return mMesh;
508
    }
509

    
510
///////////////////////////////////////////////////////////////////////////////////////////////////
511
/**
512
 * Resizes the DistortedFramebuffer object that we render this Node to.
513
 */
514
  public void resizeFBO(int width, int height)
515
    {
516
    mFboW = width;
517
    mFboH = height;
518

    
519
    if ( mData.mFBO !=null )
520
      {
521
      // TODO: potentially allocate a new NodeData if we have to
522
      mData.mFBO.resize(width,height);
523
      }
524
    }
525

    
526
///////////////////////////////////////////////////////////////////////////////////////////////////
527
/**
528
 * Enables/disables DEPTH and STENCIL buffers in the Framebuffer object that we render this Node to.
529
 */
530
  public void enableDepthStencil(int depthStencil)
531
    {
532
    mFboDepthStencil = depthStencil;
533

    
534
    if ( mData.mFBO !=null )
535
      {
536
      // TODO: potentially allocate a new NodeData if we have to
537
      mData.mFBO.enableDepthStencil(depthStencil);
538
      }
539
    }
540

    
541
///////////////////////////////////////////////////////////////////////////////////////////////////
542
// APIs that control how to set the OpenGL state just before rendering this Node.
543
///////////////////////////////////////////////////////////////////////////////////////////////////
544
/**
545
 * When rendering this Node, use ColorMask (r,g,b,a).
546
 *
547
 * @param r Write to the RED color channel when rendering this Node?
548
 * @param g Write to the GREEN color channel when rendering this Node?
549
 * @param b Write to the BLUE color channel when rendering this Node?
550
 * @param a Write to the ALPHA channel when rendering this Node?
551
 */
552
  @SuppressWarnings("unused")
553
  public void glColorMask(boolean r, boolean g, boolean b, boolean a)
554
    {
555
    mState.glColorMask(r,g,b,a);
556
    }
557

    
558
///////////////////////////////////////////////////////////////////////////////////////////////////
559
/**
560
 * When rendering this Node, switch on writing to Depth buffer?
561
 *
562
 * @param mask Write to the Depth buffer when rendering this Node?
563
 */
564
  @SuppressWarnings("unused")
565
  public void glDepthMask(boolean mask)
566
    {
567
    mState.glDepthMask(mask);
568
    }
569

    
570
///////////////////////////////////////////////////////////////////////////////////////////////////
571
/**
572
 * When rendering this Node, which bits of the Stencil buffer to write to?
573
 *
574
 * @param mask Marks the bits of the Stencil buffer we will write to when rendering this Node.
575
 */
576
  @SuppressWarnings("unused")
577
  public void glStencilMask(int mask)
578
    {
579
    mState.glStencilMask(mask);
580
    }
581

    
582
///////////////////////////////////////////////////////////////////////////////////////////////////
583
/**
584
 * When rendering this Node, which Tests to enable?
585
 *
586
 * @param test Valid values: GL_DEPTH_TEST, GL_STENCIL_TEST, GL_BLEND
587
 */
588
  @SuppressWarnings("unused")
589
  public void glEnable(int test)
590
    {
591
    mState.glEnable(test);
592
    }
593

    
594
///////////////////////////////////////////////////////////////////////////////////////////////////
595
/**
596
 * When rendering this Node, which Tests to enable?
597
 *
598
 * @param test Valid values: GL_DEPTH_TEST, GL_STENCIL_TEST, GL_BLEND
599
 */
600
  @SuppressWarnings("unused")
601
  public void glDisable(int test)
602
    {
603
    mState.glDisable(test);
604
    }
605

    
606
///////////////////////////////////////////////////////////////////////////////////////////////////
607
/**
608
 * When rendering this Node, use the following StencilFunc.
609
 *
610
 * @param func Valid values: GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL
611
 * @param ref  Reference valut to compare our stencil with.
612
 * @param mask Mask used when comparing.
613
 */
614
  @SuppressWarnings("unused")
615
  public void glStencilFunc(int func, int ref, int mask)
616
    {
617
    mState.glStencilFunc(func,ref,mask);
618
    }
619

    
620
///////////////////////////////////////////////////////////////////////////////////////////////////
621
/**
622
 * When rendering this Node, use the following StencilOp.
623
 * <p>
624
 * Valid values of all 3 parameters: GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP
625
 *
626
 * @param sfail  What to do when Stencil Test fails.
627
 * @param dpfail What to do when Depth Test fails.
628
 * @param dppass What to do when Depth Test passes.
629
 */
630
  @SuppressWarnings("unused")
631
  public void glStencilOp(int sfail, int dpfail, int dppass)
632
    {
633
    mState.glStencilOp(sfail,dpfail,dppass);
634
    }
635

    
636
///////////////////////////////////////////////////////////////////////////////////////////////////
637
/**
638
 * When rendering this Node, use the following DepthFunc.
639
 *
640
 * @param func Valid values: GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL
641
 */
642
  @SuppressWarnings("unused")
643
  public void glDepthFunc(int func)
644
    {
645
    mState.glDepthFunc(func);
646
    }
647

    
648
///////////////////////////////////////////////////////////////////////////////////////////////////
649
/**
650
 * When rendering this Node, use the following Blending mode.
651
 * <p>
652
 * Valid values: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
653
 *               GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR,
654
 *               GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, GL_SRC_ALPHA_SATURATE
655
 *
656
 * @param src Source Blend function
657
 * @param dst Destination Blend function
658
 */
659
  @SuppressWarnings("unused")
660
  public void glBlendFunc(int src, int dst)
661
    {
662
    mState.glBlendFunc(src,dst);
663
    }
664

    
665
///////////////////////////////////////////////////////////////////////////////////////////////////
666
/**
667
 * Before rendering this Node, clear the following buffers.
668
 * <p>
669
 * Valid values: 0, or bitwise OR of one or more values from the set GL_COLOR_BUFFER_BIT,
670
 *               GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT.
671
 * Default: 0
672
 *
673
 * @param mask bitwise OR of BUFFER_BITs to clear.
674
 */
675
  @SuppressWarnings("unused")
676
  public void glClear(int mask)
677
    {
678
    mState.glClear(mask);
679
    }
680
  }
(4-4/14)