Project

General

Profile

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

library / src / main / java / org / distorted / library / DistortedNode.java @ 13687207

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;
21

    
22
import java.util.ArrayList;
23
import java.util.HashMap;
24

    
25
import android.opengl.GLES30;
26

    
27
///////////////////////////////////////////////////////////////////////////////////////////////////
28
/**
29
 * Class which represents a Node in a Tree of (InputSurface,Mesh,Effects) triplets.
30
 * <p>
31
 * Having organized such sets into a Tree, we can then render any Node to any OutputSurface.
32
 * That recursively renders the set held in the Node and all its children.
33
 * <p>
34
 * The class takes special care to only render identical sub-trees once. Each Node holds a reference
35
 * to sub-class 'NodeData'. Two identical sub-trees attached at different points of the main tree
36
 * will point to the same NodeData; only the first of this is rendered (mData.numRender!).
37
 */
38
public class DistortedNode implements DistortedAttacheable
39
  {
40
  private static HashMap<ArrayList<Long>,NodeData> mMapNodeID = new HashMap<>();
41
  private static long mNextNodeID =0;
42

    
43
  private DistortedNode mParent;
44
  private MeshObject mMesh;
45
  private DistortedEffects mEffects;
46
  private DistortedEffectsPostprocess mPostprocess;
47
  private DistortedInputSurface mSurface;
48
  private DistortedRenderState mState;
49
  private NodeData mData;
50

    
51
  private ArrayList<DistortedNode> mChildren;
52
  private int[] mNumChildren;  // ==mChildren.length(), but we only create mChildren if the first one gets added
53

    
54
  private class NodeData
55
    {
56
    long ID;
57
    int numPointingNodes;
58
    long currTime;
59
    ArrayList<Long> key;
60
    DistortedFramebuffer mFBO;
61

    
62
    NodeData(long id, ArrayList<Long> k)
63
      {
64
      ID              = id;
65
      key             = k;
66
      numPointingNodes= 1;
67
      currTime        =-1;
68
      mFBO            = null;
69
      }
70
    }
71
 
72
///////////////////////////////////////////////////////////////////////////////////////////////////
73

    
74
  static synchronized void onDestroy()
75
    {
76
    mNextNodeID = 0;
77
    mMapNodeID.clear();
78
    }
79

    
80
///////////////////////////////////////////////////////////////////////////////////////////////////
81

    
82
  private ArrayList<Long> generateIDList()
83
    {
84
    ArrayList<Long> ret = new ArrayList<>();
85
     
86
    ret.add( mSurface.getID() );
87

    
88
    if( mNumChildren[0]==0 )
89
      {
90
      ret.add(-mEffects.getID());
91
      }
92

    
93
    DistortedNode node;
94
   
95
    for(int i=0; i<mNumChildren[0]; i++)
96
      {
97
      node = mChildren.get(i);
98
      ret.add(node.mData.ID);
99
      }
100
   
101
    return ret;
102
    }
103

    
104
///////////////////////////////////////////////////////////////////////////////////////////////////
105
// Debug - print all the Node IDs
106

    
107
  @SuppressWarnings("unused")
108
  void debug(int depth)
109
    {
110
    String tmp="";
111
    int i;
112

    
113
    for(i=0; i<depth; i++) tmp +="   ";
114
    tmp += ("NodeID="+mData.ID+" nodes pointing: "+mData.numPointingNodes+" surfaceID="+
115
            mSurface.getID()+" FBO="+(mData.mFBO==null ? "null":mData.mFBO.getID()))+
116
            " parent sID="+(mParent==null ? "null": (mParent.mSurface.getID()));
117

    
118
    android.util.Log.e("NODE", tmp);
119

    
120
    for(i=0; i<mNumChildren[0]; i++)
121
      mChildren.get(i).debug(depth+1);
122
    }
123

    
124
///////////////////////////////////////////////////////////////////////////////////////////////////
125
// Debug - print contents of the HashMap
126

    
127
  @SuppressWarnings("unused")
128
  static void debugMap()
129
    {
130
    NodeData tmp;
131

    
132
    for(ArrayList<Long> key: mMapNodeID.keySet())
133
      {
134
      tmp = mMapNodeID.get(key);
135
      android.util.Log.e("NODE", "NodeID: "+tmp.ID+" <-- "+key);
136
      }
137
    }
138

    
139
///////////////////////////////////////////////////////////////////////////////////////////////////
140
// tree isomorphism algorithm
141

    
142
  private void adjustIsomorphism()
143
    {
144
    ArrayList<Long> newList = generateIDList();
145
    NodeData newData = mMapNodeID.get(newList);
146

    
147
    if( newData!=null )
148
      {
149
      newData.numPointingNodes++;
150
      }
151
    else
152
      {
153
      newData = new NodeData(++mNextNodeID,newList);
154
      mMapNodeID.put(newList,newData);
155
      }
156

    
157
    boolean deleteOldFBO = false;
158
    boolean createNewFBO = false;
159

    
160
    if( --mData.numPointingNodes==0 )
161
      {
162
      mMapNodeID.remove(mData.key);
163
      if( mData.mFBO!=null ) deleteOldFBO=true;
164
      }
165
    if( mNumChildren[0]>0 && newData.mFBO==null )
166
      {
167
      createNewFBO = true;
168
      }
169
    if( mNumChildren[0]==0 && newData.mFBO!=null )
170
      {
171
      newData.mFBO.markForDeletion();
172
      android.util.Log.d("NODE", "ERROR!! this NodeData cannot possibly contain a non-null FBO!! "+newData.mFBO.getID() );
173
      newData.mFBO = null;
174
      }
175

    
176
    if( deleteOldFBO && createNewFBO )
177
      {
178
      newData.mFBO = mData.mFBO;  // just copy over
179
      //android.util.Log.d("NODE", "copying over FBOs "+mData.mFBO.getID() );
180
      }
181
    else if( deleteOldFBO )
182
      {
183
      mData.mFBO.markForDeletion();
184
      //android.util.Log.d("NODE", "deleting old FBO "+mData.mFBO.getID() );
185
      mData.mFBO = null;
186
      }
187
    else if( createNewFBO )
188
      {
189
      newData.mFBO = new DistortedFramebuffer(true, DistortedSurface.TYPE_TREE, mSurface.getWidth(),mSurface.getHeight());
190
      //android.util.Log.d("NODE", "creating new FBO "+newData.mFBO.getID() );
191
      }
192

    
193
    mData = newData;
194

    
195
    if( mParent!=null ) mParent.adjustIsomorphism();
196
    }
197

    
198
///////////////////////////////////////////////////////////////////////////////////////////////////
199
// return the total number of render calls issued
200

    
201
  int draw(long currTime, DistortedOutputSurface surface)
202
    {
203
    DistortedInputSurface input = mNumChildren[0]==0 ? mSurface : mData.mFBO;
204

    
205
    if( input.setAsInput() )
206
      {
207
      mState.apply();
208
      mEffects.drawPriv(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
209
      return 1;
210
      }
211

    
212
    return 0;
213
    }
214

    
215
///////////////////////////////////////////////////////////////////////////////////////////////////
216

    
217
  EffectQueuePostprocess getPostprocess()
218
    {
219
    return mPostprocess==null ? null : mPostprocess.getPostprocess();
220
    }
221

    
222
///////////////////////////////////////////////////////////////////////////////////////////////////
223
// return the total number of render calls issued
224

    
225
  int renderRecursive(long currTime)
226
    {
227
    int numRenders = 0;
228

    
229
    if( mNumChildren[0]>0 && mData.currTime!=currTime )
230
      {
231
      mData.currTime = currTime;
232

    
233
      for (int i=0; i<mNumChildren[0]; i++)
234
        {
235
        numRenders += mChildren.get(i).renderRecursive(currTime);
236
        }
237

    
238
      mData.mFBO.setAsOutput(currTime);
239

    
240
      if( mSurface.setAsInput() )
241
        {
242
        numRenders++;
243
        DistortedEffects.blitPriv(mData.mFBO);
244
        }
245

    
246
      numRenders += mData.mFBO.renderChildren(currTime,mNumChildren[0],mChildren);
247
      }
248

    
249
    return numRenders;
250
    }
251

    
252
///////////////////////////////////////////////////////////////////////////////////////////////////
253
// PUBLIC API
254
///////////////////////////////////////////////////////////////////////////////////////////////////
255
/**
256
 * Constructs new Node.
257
 *     
258
 * @param surface InputSurface to put into the new Node.
259
 * @param effects DistortedEffects to put into the new Node.
260
 * @param mesh MeshObject to put into the new Node.
261
 */
262
  public DistortedNode(DistortedInputSurface surface, DistortedEffects effects, MeshObject mesh)
263
    {
264
    mSurface       = surface;
265
    mEffects       = effects;
266
    mPostprocess   = null;
267
    mMesh          = mesh;
268
    mState         = new DistortedRenderState();
269
    mChildren      = null;
270
    mNumChildren   = new int[1];
271
    mNumChildren[0]= 0;
272
    mParent        = null;
273

    
274
    ArrayList<Long> list = new ArrayList<>();
275
    list.add(mSurface.getID());
276
    list.add(-mEffects.getID());
277

    
278
    mData = mMapNodeID.get(list);
279
   
280
    if( mData!=null )
281
      {
282
      mData.numPointingNodes++;
283
      }
284
    else
285
      {
286
      mData = new NodeData(++mNextNodeID,list);
287
      mMapNodeID.put(list, mData);
288
      }
289
    }
290

    
291
///////////////////////////////////////////////////////////////////////////////////////////////////  
292
/**
293
 * Copy-constructs new Node from another Node.
294
 *     
295
 * @param node The DistortedNode to copy data from.
296
 * @param flags bit field composed of a subset of the following:
297
 *        {@link Distorted#CLONE_SURFACE},  {@link Distorted#CLONE_MATRIX}, {@link Distorted#CLONE_VERTEX},
298
 *        {@link Distorted#CLONE_FRAGMENT} and {@link Distorted#CLONE_CHILDREN}.
299
 *        For example flags = CLONE_SURFACE | CLONE_CHILDREN.
300
 */
301
  public DistortedNode(DistortedNode node, int flags)
302
    {
303
    mEffects     = new DistortedEffects(node.mEffects,flags);
304
    mPostprocess = null;
305
    mMesh        = node.mMesh;
306
    mState       = new DistortedRenderState();
307
    mParent      = null;
308

    
309
    if( (flags & Distorted.CLONE_SURFACE) != 0 )
310
      {
311
      mSurface = node.mSurface;
312
      }
313
    else
314
      {
315
      int w = node.mSurface.getWidth();
316
      int h = node.mSurface.getHeight();
317

    
318
      if( node.mSurface instanceof DistortedTexture )
319
        {
320
        mSurface = new DistortedTexture(w,h, DistortedSurface.TYPE_TREE);
321
        }
322
      else if( node.mSurface instanceof DistortedFramebuffer )
323
        {
324
        boolean hasDepth = ((DistortedFramebuffer) node.mSurface).hasDepth();
325
        mSurface = new DistortedFramebuffer(hasDepth,DistortedSurface.TYPE_TREE,w,h);
326
        }
327
      }
328
    if( (flags & Distorted.CLONE_CHILDREN) != 0 )
329
      {
330
      if( node.mChildren==null )     // do NOT copy over the NULL!
331
        {
332
        node.mChildren = new ArrayList<>(2);
333
        }
334

    
335
      mChildren = node.mChildren;
336
      mNumChildren = node.mNumChildren;
337
      }
338
    else
339
      {
340
      mChildren = null;
341
      mNumChildren = new int[1];
342
      mNumChildren[0] = 0;
343
      }
344
   
345
    ArrayList<Long> list = generateIDList();
346
   
347
    mData = mMapNodeID.get(list);
348
   
349
    if( mData!=null )
350
      {
351
      mData.numPointingNodes++;
352
      }
353
    else
354
      {
355
      mData = new NodeData(++mNextNodeID,list);
356
      mMapNodeID.put(list, mData);
357
      }
358
    }
359

    
360
///////////////////////////////////////////////////////////////////////////////////////////////////
361
/**
362
 * Adds a new child to the last position in the list of our Node's children.
363
 * <p>
364
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
365
 * DistortedAttachDeamon (by calling attachNow())
366
 *
367
 * @param node The new Node to add.
368
 */
369
  public void attach(DistortedNode node)
370
    {
371
    DistortedAttachDaemon.attach(this,node);
372
    }
373

    
374
///////////////////////////////////////////////////////////////////////////////////////////////////
375
/**
376
 * Adds a new child to the last position in the list of our Node's children.
377
 * <p>
378
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
379
 * DistortedAttachDeamon (by calling attachNow())
380
 *
381
 * @param surface InputSurface to initialize our child Node with.
382
 * @param effects DistortedEffects to initialize our child Node with.
383
 * @param mesh MeshObject to initialize our child Node with.
384
 * @return the newly constructed child Node, or null if we couldn't allocate resources.
385
 */
386
  public DistortedNode attach(DistortedInputSurface surface, DistortedEffects effects, MeshObject mesh)
387
    {
388
    DistortedNode node = new DistortedNode(surface,effects,mesh);
389
    DistortedAttachDaemon.attach(this,node);
390
    return node;
391
    }
392

    
393
///////////////////////////////////////////////////////////////////////////////////////////////////
394
/**
395
 * This is not really part of the public API. Has to be public only because it is a part of the
396
 * DistortedAttacheable interface, which should really be a class that we extend here instead but
397
 * Java has no multiple inheritance.
398
 *
399
 * @y.exclude
400
 * @param node The new Node to add.
401
 */
402
  public void attachNow(DistortedNode node)
403
    {
404
    if( mChildren==null ) mChildren = new ArrayList<>(2);
405

    
406
    node.mParent = this;
407
    mChildren.add(node);
408
    mNumChildren[0]++;
409
    adjustIsomorphism();
410
    }
411

    
412
///////////////////////////////////////////////////////////////////////////////////////////////////
413
/**
414
 * Removes the first occurrence of a specified child from the list of children of our Node.
415
 * <p>
416
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
417
 * DistortedAttachDeamon (by calling detachNow())
418
 *
419
 * @param node The Node to remove.
420
 */
421
  public void detach(DistortedNode node)
422
    {
423
    DistortedAttachDaemon.detach(this,node);
424
    }
425

    
426
///////////////////////////////////////////////////////////////////////////////////////////////////
427
/**
428
 * Removes the first occurrence of a specified child from the list of children of our Node.
429
 * <p>
430
 * A bit questionable method as there can be many different Nodes attached as children, some
431
 * of them having the same Effects but - for instance - different Mesh. Use with care.
432
 * <p>
433
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
434
 * DistortedAttachDeamon (by calling detachNow())
435
 *
436
 * @param effects DistortedEffects to remove.
437
 */
438
  public void detach(DistortedEffects effects)
439
    {
440
    long id = effects.getID();
441
    DistortedNode node;
442
    boolean detached= false;
443

    
444
    for(int i=0; i<mNumChildren[0]; i++)
445
      {
446
      node = mChildren.get(i);
447

    
448
      if( node.mEffects.getID()==id )
449
        {
450
        detached=true;
451
        DistortedAttachDaemon.detach(this,node);
452
        break;
453
        }
454
      }
455

    
456
    if( !detached )
457
      {
458
      // if we failed to detach any, it still might be the case that
459
      // there's a job in Daemon's queue that we need to cancel.
460
      DistortedAttachDaemon.cancelAttachJobs(this,effects);
461
      }
462
    }
463

    
464
///////////////////////////////////////////////////////////////////////////////////////////////////
465
/**
466
 * This is not really part of the public API. Has to be public only because it is a part of the
467
 * DistortedAttacheable interface, which should really be a class that we extend here instead but
468
 * Java has no multiple inheritance.
469
 *
470
 * @y.exclude
471
 * @param node The Node to remove.
472
 */
473
  public void detachNow(DistortedNode node)
474
    {
475
    if( mNumChildren[0]>0 && mChildren.remove(node) )
476
      {
477
      node.mParent = null;
478
      mNumChildren[0]--;
479
      adjustIsomorphism();
480
      }
481
    }
482

    
483
///////////////////////////////////////////////////////////////////////////////////////////////////
484
/**
485
 * Removes all children Nodes.
486
 * <p>
487
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
488
 * DistortedAttachDeamon (by calling detachAllNow())
489
 */
490
  public void detachAll()
491
    {
492
    DistortedAttachDaemon.detachAll(this);
493
    }
494

    
495
///////////////////////////////////////////////////////////////////////////////////////////////////
496
/**
497
 * This is not really part of the public API. Has to be public only because it is a part of the
498
 * DistortedAttacheable interface, which should really be a class that we extend here instead but
499
 * Java has no multiple inheritance.
500
 *
501
 * @y.exclude
502
 */
503
  public void detachAllNow()
504
    {
505
    if( mNumChildren[0]>0 )
506
      {
507
      DistortedNode tmp;
508

    
509
      for(int i=mNumChildren[0]-1; i>=0; i--)
510
        {
511
        tmp = mChildren.remove(i);
512
        tmp.mParent = null;
513
        }
514

    
515
      mNumChildren[0] = 0;
516
      adjustIsomorphism();
517
      }
518
    }
519

    
520
///////////////////////////////////////////////////////////////////////////////////////////////////
521
/**
522
 * Sets the Postprocessing Effects we will apply to the temporary buffer this Node - and fellow siblings
523
 * with the same Effects - will get rendered to.
524
 * <p>
525
 * For efficiency reasons, it is very important to assign the very same DistortedEffectsPostprocess
526
 * object to all the DistortedNode siblings that are supposed to be postprocessed in the same way,
527
 * because only then will the library assign all such siblings to the same 'Bucket' which gets rendered
528
 * to the same offscreen buffer which then gets postprocessed in one go and subsequently merged to the
529
 * target Surface.
530
 */
531
  public void setPostprocessEffects(DistortedEffectsPostprocess dep)
532
    {
533
    mPostprocess = dep;
534

    
535
    // TODO: rearrange all the siblings so that all are sorted by the DistortedEffectsPostprocess' ID.
536
    }
537

    
538
///////////////////////////////////////////////////////////////////////////////////////////////////
539
/**
540
 * Returns the DistortedEffects object that's in the Node.
541
 * 
542
 * @return The DistortedEffects contained in the Node.
543
 */
544
  public DistortedEffects getEffects()
545
    {
546
    return mEffects;
547
    }
548

    
549
///////////////////////////////////////////////////////////////////////////////////////////////////
550
/**
551
 * Returns the DistortedInputSurface object that's in the Node.
552
 *
553
 * @return The DistortedInputSurface contained in the Node.
554
 */
555
  public DistortedInputSurface getSurface()
556
    {
557
    return mSurface;
558
    }
559

    
560
///////////////////////////////////////////////////////////////////////////////////////////////////
561
/**
562
 * Returns the DistortedFramebuffer object that's in the Node.
563
 *
564
 * @return The DistortedFramebuffer contained in the Node.
565
 */
566
  public DistortedFramebuffer getFramebuffer()
567
    {
568
    return mData.mFBO;
569
    }
570

    
571

    
572
///////////////////////////////////////////////////////////////////////////////////////////////////
573
/**
574
 * When rendering this Node, use ColorMask (r,g,b,a).
575
 *
576
 * @param r Write to the RED color channel when rendering this Node?
577
 * @param g Write to the GREEN color channel when rendering this Node?
578
 * @param b Write to the BLUE color channel when rendering this Node?
579
 * @param a Write to the ALPHA channel when rendering this Node?
580
 */
581
  @SuppressWarnings("unused")
582
  public void glColorMask(boolean r, boolean g, boolean b, boolean a)
583
    {
584
    mState.glColorMask(r,g,b,a);
585
    }
586

    
587
///////////////////////////////////////////////////////////////////////////////////////////////////
588
/**
589
 * When rendering this Node, switch on writing to Depth buffer?
590
 *
591
 * @param mask Write to the Depth buffer when rendering this Node?
592
 */
593
  @SuppressWarnings("unused")
594
  public void glDepthMask(boolean mask)
595
    {
596
    mState.glDepthMask(mask);
597
    }
598

    
599
///////////////////////////////////////////////////////////////////////////////////////////////////
600
/**
601
 * When rendering this Node, which bits of the Stencil buffer to write to?
602
 *
603
 * @param mask Marks the bits of the Stencil buffer we will write to when rendering this Node.
604
 */
605
  @SuppressWarnings("unused")
606
  public void glStencilMask(int mask)
607
    {
608
    mState.glStencilMask(mask);
609
    }
610

    
611
///////////////////////////////////////////////////////////////////////////////////////////////////
612
/**
613
 * When rendering this Node, which Tests to enable?
614
 *
615
 * @param test Valid values: GL_DEPTH_TEST, GL_STENCIL_TEST, GL_BLEND
616
 */
617
  @SuppressWarnings("unused")
618
  public void glEnable(int test)
619
    {
620
    mState.glEnable(test);
621
    }
622

    
623
///////////////////////////////////////////////////////////////////////////////////////////////////
624
/**
625
 * When rendering this Node, which Tests to enable?
626
 *
627
 * @param test Valid values: GL_DEPTH_TEST, GL_STENCIL_TEST, GL_BLEND
628
 */
629
  @SuppressWarnings("unused")
630
  public void glDisable(int test)
631
    {
632
    mState.glDisable(test);
633
    }
634

    
635
///////////////////////////////////////////////////////////////////////////////////////////////////
636
/**
637
 * When rendering this Node, use the following StencilFunc.
638
 *
639
 * @param func Valid values: GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL
640
 * @param ref  Reference valut to compare our stencil with.
641
 * @param mask Mask used when comparing.
642
 */
643
  @SuppressWarnings("unused")
644
  public void glStencilFunc(int func, int ref, int mask)
645
    {
646
    mState.glStencilFunc(func,ref,mask);
647
    }
648

    
649
///////////////////////////////////////////////////////////////////////////////////////////////////
650
/**
651
 * When rendering this Node, use the following StencilOp.
652
 * <p>
653
 * Valid values of all 3 parameters: GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP
654
 *
655
 * @param sfail  What to do when Stencil Test fails.
656
 * @param dpfail What to do when Depth Test fails.
657
 * @param dppass What to do when Depth Test passes.
658
 */
659
  @SuppressWarnings("unused")
660
  public void glStencilOp(int sfail, int dpfail, int dppass)
661
    {
662
    mState.glStencilOp(sfail,dpfail,dppass);
663
    }
664

    
665
///////////////////////////////////////////////////////////////////////////////////////////////////
666
/**
667
 * When rendering this Node, use the following DepthFunc.
668
 *
669
 * @param func Valid values: GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL
670
 */
671
  @SuppressWarnings("unused")
672
  public void glDepthFunc(int func)
673
    {
674
    mState.glDepthFunc(func);
675
    }
676

    
677
///////////////////////////////////////////////////////////////////////////////////////////////////
678
/**
679
 * When rendering this Node, use the following Blending mode.
680
 * <p>
681
 * Valid values: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
682
 *               GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR,
683
 *               GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, GL_SRC_ALPHA_SATURATE
684
 *
685
 * @param src Source Blend function
686
 * @param dst Destination Blend function
687
 */
688
  @SuppressWarnings("unused")
689
  public void glBlendFunc(int src, int dst)
690
    {
691
    mState.glBlendFunc(src,dst);
692
    }
693
  }
(8-8/24)