Project

General

Profile

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

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

1 d333eb6b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
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 6a06a912 Leszek Koltunski
package org.distorted.library;
21
22
import java.util.ArrayList;
23
import java.util.HashMap;
24
25 194ab46f Leszek Koltunski
import android.opengl.GLES30;
26 6a06a912 Leszek Koltunski
27
///////////////////////////////////////////////////////////////////////////////////////////////////
28
/**
29 a09ada4c Leszek Koltunski
 * Class which represents a Node in a Tree of (InputSurface,Mesh,Effects) triplets.
30 c204c69d leszek
 * <p>
31 a09ada4c Leszek Koltunski
 * Having organized such sets into a Tree, we can then render any Node to any OutputSurface.
32 7b8086eb Leszek Koltunski
 * That recursively renders the set held in the Node and all its children.
33 c204c69d leszek
 * <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 (when mData.numRendered==0).
37 6a06a912 Leszek Koltunski
 */
38 c204c69d leszek
public class DistortedNode implements DistortedAttacheable
39 6a06a912 Leszek Koltunski
  {
40 bd3da5b2 Leszek Koltunski
  private static HashMap<ArrayList<Long>,NodeData> mMapNodeID = new HashMap<>();
41
  private static long mNextNodeID =0;
42
43 05403bba Leszek Koltunski
  private MeshObject mMesh;
44 07d8ef09 Leszek Koltunski
  private DistortedEffects mEffects;
45 c5369f1b leszek
  private DistortedInputSurface mSurface;
46 6a06a912 Leszek Koltunski
  private NodeData mData;
47 bd3da5b2 Leszek Koltunski
48 a09ada4c Leszek Koltunski
  private ArrayList<DistortedNode> mChildren;
49 6a06a912 Leszek Koltunski
  private int[] mNumChildren;  // ==mChildren.length(), but we only create mChildren if the first one gets added
50
51
  private class NodeData
52
    {
53 bd3da5b2 Leszek Koltunski
    long ID;
54 6a06a912 Leszek Koltunski
    int numPointingNodes;
55 d620ff06 Leszek Koltunski
    int numRendered;
56 8c327653 Leszek Koltunski
    DistortedFramebuffer mFBO;
57 6a06a912 Leszek Koltunski
58 bd3da5b2 Leszek Koltunski
    NodeData(long id)
59 6a06a912 Leszek Koltunski
      {
60 bd3da5b2 Leszek Koltunski
      ID              = id;
61
      numPointingNodes= 1;
62 d620ff06 Leszek Koltunski
      numRendered     = 0;
63 8c327653 Leszek Koltunski
      mFBO            = null;
64 6a06a912 Leszek Koltunski
      }
65 bd3da5b2 Leszek Koltunski
    }
66 6a06a912 Leszek Koltunski
 
67 436899f2 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
68
69 7b8086eb Leszek Koltunski
  static synchronized void onDestroy()
70 436899f2 Leszek Koltunski
    {
71
    mNextNodeID = 0;
72
    mMapNodeID.clear();
73
    }
74
75 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
76
77
  private ArrayList<Long> generateIDList()
78
    {
79 9361b337 Leszek Koltunski
    ArrayList<Long> ret = new ArrayList<>();
80 6a06a912 Leszek Koltunski
     
81 c5369f1b leszek
    ret.add( mSurface.getID() );
82 a09ada4c Leszek Koltunski
    DistortedNode node;
83 6a06a912 Leszek Koltunski
   
84
    for(int i=0; i<mNumChildren[0]; i++)
85
      {
86
      node = mChildren.get(i);
87
      ret.add(node.mData.ID);
88
      }
89
   
90
    return ret;
91
    }
92
93
///////////////////////////////////////////////////////////////////////////////////////////////////  
94
// this will be called on startup and every time OpenGL context has been lost
95 d620ff06 Leszek Koltunski
96 6a06a912 Leszek Koltunski
  static void reset()
97
    {
98
    NodeData tmp;   
99
     
100
    for(ArrayList<Long> key: mMapNodeID.keySet())
101
      {
102
      tmp = mMapNodeID.get(key);
103
          
104 02de77c9 Leszek Koltunski
      if( tmp.mFBO != null ) tmp.numRendered = 0;
105 6a06a912 Leszek Koltunski
      }
106
    }
107 fee0865c Leszek Koltunski
108
///////////////////////////////////////////////////////////////////////////////////////////////////
109
// Debug - print all the Node IDs
110 c204c69d leszek
111 fee0865c Leszek Koltunski
  void debug(int depth)
112
    {
113
    String tmp="";
114
    int i;
115
116
    for(i=0; i<depth; i++) tmp +="   ";
117 c204c69d leszek
    tmp += ("NodeID="+mData.ID+" (nodes pointing: "+mData.numPointingNodes+" surfaceID="+mSurface.getID()+")");
118 fee0865c Leszek Koltunski
119 1942537e Leszek Koltunski
    android.util.Log.e("NODE", tmp);
120 fee0865c Leszek Koltunski
121
    for(i=0; i<mNumChildren[0]; i++)
122
      mChildren.get(i).debug(depth+1);
123
    }
124
125
///////////////////////////////////////////////////////////////////////////////////////////////////
126
// Debug - print contents of the HashMap
127
128
  static void debugMap()
129
    {
130
    NodeData tmp;
131
132
    for(ArrayList<Long> key: mMapNodeID.keySet())
133
      {
134
      tmp = mMapNodeID.get(key);
135 c204c69d leszek
      android.util.Log.e("NODE", "NodeID: "+tmp.ID+" <-- "+key);
136
      }
137
    }
138
139
///////////////////////////////////////////////////////////////////////////////////////////////////
140
141
  void treeIsomorphism()
142
    {
143
    android.util.Log.e("NODE", "begin treeIso for Node Surface ID="+mSurface.getID());
144
    debug(0);
145
    debugMap();
146
    android.util.Log.e("NODE", "begin treeIso for Node Surface ID="+mSurface.getID());
147
148
    ArrayList<Long> oldList = generateIDList();
149
150
    for(int i=0; i<mNumChildren[0]; i++)
151
      {
152
      mChildren.get(i).treeIsomorphism();
153
      }
154
155
    ArrayList<Long> newList = generateIDList();
156
    NodeData newData = mMapNodeID.get(newList);
157
158
    if( newData==null )
159
      {
160
      android.util.Log.d("NODE", "  inserted newData to map, newList="+newList);
161
162
163
      newData = new NodeData(++mNextNodeID);
164
      mMapNodeID.put(newList,newData);
165
      debugMap();
166
      }
167
    else if( newData.ID != mData.ID )
168
      {
169
      newData.numPointingNodes++;
170
      }
171
172
    if( newData.ID != mData.ID )
173
      {
174
      boolean fboUsed = false;
175
176
      if( mNumChildren[0]>0 && newData.mFBO==null )
177
        {
178
        if( mData.mFBO!=null )
179
          {
180
          newData.mFBO = mData.mFBO;
181
          fboUsed = true;
182
          }
183
        else
184
          {
185
          newData.mFBO = new DistortedFramebuffer(mSurface.getWidth(),mSurface.getHeight());
186
          }
187
        }
188
      if( mNumChildren[0]==0 && newData.mFBO!=null )
189
        {
190
        newData.mFBO.markForDeletion();
191
        newData.mFBO = null;
192
        }
193
194
      if( --mData.numPointingNodes==0 )
195
        {
196
        android.util.Log.d("NODE", "  removed oldData to map, oldList="+oldList);
197
198 fee0865c Leszek Koltunski
199 c204c69d leszek
        mMapNodeID.remove(oldList);
200
        debugMap();
201
202
        if( !fboUsed && mData.mFBO!=null )
203
          {
204
          mData.mFBO.markForDeletion();
205
          mData.mFBO = null;
206
          }
207
        }
208
209
      mData = newData;
210 fee0865c Leszek Koltunski
      }
211 c204c69d leszek
212
    android.util.Log.e("NODE", "end treeIso for Node SurfaceID="+mSurface.getID()+" newList="+newList);
213
    debug(0);
214
    debugMap();
215
    android.util.Log.e("NODE", "end treeIso for Node SurfaceID="+mSurface.getID()+" newList="+newList);
216 fee0865c Leszek Koltunski
    }
217 c204c69d leszek
218 a0f644b7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
219
220 c5369f1b leszek
  void drawRecursive(long currTime, DistortedOutputSurface surface)
221 a0f644b7 Leszek Koltunski
    {
222 c5369f1b leszek
    float halfX = mSurface.getWidth()/2.0f;
223
    float halfY = mSurface.getHeight()/2.0f;
224 a0f644b7 Leszek Koltunski
225
    if( mNumChildren[0]<=0 )
226
      {
227 c5369f1b leszek
      mSurface.setAsInput();
228 a0f644b7 Leszek Koltunski
      }
229
    else
230
      {
231
      if( mData.numRendered==0 )
232
        {
233 8c327653 Leszek Koltunski
        mData.mFBO.setAsOutput();
234 a0f644b7 Leszek Koltunski
235 194ab46f Leszek Koltunski
        GLES30.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
236
        GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
237 a0f644b7 Leszek Koltunski
238 c5369f1b leszek
        if( mSurface.setAsInput() )
239 af4cc5db Leszek Koltunski
          DistortedEffects.drawNoEffectsPriv(halfX, halfY, mMesh, mData.mFBO );
240 a0f644b7 Leszek Koltunski
241 a09ada4c Leszek Koltunski
        for(int i=0; i<mNumChildren[0]; i++)
242 a0f644b7 Leszek Koltunski
          {
243 a09ada4c Leszek Koltunski
          mChildren.get(i).drawRecursive(currTime, mData.mFBO);
244 a0f644b7 Leszek Koltunski
          }
245
        }
246
247
      mData.numRendered++;
248
      mData.numRendered %= mData.numPointingNodes;
249 8c327653 Leszek Koltunski
      mData.mFBO.setAsInput();
250 a0f644b7 Leszek Koltunski
      }
251
252 c5369f1b leszek
    mEffects.drawPriv(halfX, halfY, mMesh, surface, currTime);
253 a0f644b7 Leszek Koltunski
    }
254
255 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
256
// PUBLIC API
257
///////////////////////////////////////////////////////////////////////////////////////////////////
258
/**
259 a09ada4c Leszek Koltunski
 * Constructs new Node.
260 6a06a912 Leszek Koltunski
 *     
261 c5369f1b leszek
 * @param surface InputSurface to put into the new Node.
262 07d8ef09 Leszek Koltunski
 * @param effects DistortedEffects to put into the new Node.
263 05403bba Leszek Koltunski
 * @param mesh MeshObject to put into the new Node.
264 6a06a912 Leszek Koltunski
 */
265 a09ada4c Leszek Koltunski
  public DistortedNode(DistortedInputSurface surface, DistortedEffects effects, MeshObject mesh)
266 6a06a912 Leszek Koltunski
    {
267 c5369f1b leszek
    mSurface       = surface;
268 8ca9f899 Leszek Koltunski
    mEffects       = effects;
269
    mMesh          = mesh;
270
    mChildren      = null;
271
    mNumChildren   = new int[1];
272
    mNumChildren[0]= 0;
273 6a06a912 Leszek Koltunski
   
274 9361b337 Leszek Koltunski
    ArrayList<Long> list = new ArrayList<>();
275 c5369f1b leszek
    list.add(mSurface.getID());
276 1942537e Leszek Koltunski
277 6a06a912 Leszek Koltunski
    mData = mMapNodeID.get(list);
278
   
279
    if( mData!=null )
280
      {
281
      mData.numPointingNodes++;
282
      }
283
    else
284
      {
285
      mData = new NodeData(++mNextNodeID);   
286 1942537e Leszek Koltunski
      mMapNodeID.put(list, mData);
287 6a06a912 Leszek Koltunski
      }
288
    }
289
290
///////////////////////////////////////////////////////////////////////////////////////////////////  
291
/**
292 a09ada4c Leszek Koltunski
 * Copy-constructs new Node from another Node.
293 6a06a912 Leszek Koltunski
 *     
294 a09ada4c Leszek Koltunski
 * @param node The DistortedNode to copy data from.
295 6a06a912 Leszek Koltunski
 * @param flags bit field composed of a subset of the following:
296 29a06526 Leszek Koltunski
 *        {@link Distorted#CLONE_SURFACE},  {@link Distorted#CLONE_MATRIX}, {@link Distorted#CLONE_VERTEX},
297 6a06a912 Leszek Koltunski
 *        {@link Distorted#CLONE_FRAGMENT} and {@link Distorted#CLONE_CHILDREN}.
298 29a06526 Leszek Koltunski
 *        For example flags = CLONE_SURFACE | CLONE_CHILDREN.
299 6a06a912 Leszek Koltunski
 */
300 a09ada4c Leszek Koltunski
  public DistortedNode(DistortedNode node, int flags)
301 6a06a912 Leszek Koltunski
    {
302 432442f9 Leszek Koltunski
    mEffects= new DistortedEffects(node.mEffects,flags);
303 05403bba Leszek Koltunski
    mMesh = node.mMesh;
304 9361b337 Leszek Koltunski
305 29a06526 Leszek Koltunski
    if( (flags & Distorted.CLONE_SURFACE) != 0 )
306 e7a20702 Leszek Koltunski
      {
307 c5369f1b leszek
      mSurface = node.mSurface;
308 e7a20702 Leszek Koltunski
      }
309
    else
310
      {
311 c5369f1b leszek
      int w = node.mSurface.getWidth();
312
      int h = node.mSurface.getHeight();
313 8ca9f899 Leszek Koltunski
314 c5369f1b leszek
      if( node.mSurface instanceof DistortedTexture )
315 8ca9f899 Leszek Koltunski
        {
316 c5369f1b leszek
        mSurface = new DistortedTexture(w,h);
317 8ca9f899 Leszek Koltunski
        }
318 c5369f1b leszek
      else if( node.mSurface instanceof DistortedFramebuffer )
319 8ca9f899 Leszek Koltunski
        {
320 c5369f1b leszek
        boolean hasDepth = ((DistortedFramebuffer) node.mSurface).hasDepth();
321
        mSurface = new DistortedFramebuffer(w,h,hasDepth);
322 8ca9f899 Leszek Koltunski
        }
323 e7a20702 Leszek Koltunski
      }
324 9361b337 Leszek Koltunski
    if( (flags & Distorted.CLONE_CHILDREN) != 0 )
325 6a06a912 Leszek Koltunski
      {
326 c204c69d leszek
      if( node.mChildren==null )     // do NOT copy over the NULL!
327
        {
328
        node.mChildren = new ArrayList<>(2);
329
        }
330
331 6a06a912 Leszek Koltunski
      mChildren = node.mChildren;
332
      mNumChildren = node.mNumChildren;
333
      }
334
    else
335
      {
336
      mChildren = null;
337
      mNumChildren = new int[1];
338
      mNumChildren[0] = 0;
339
      }
340
   
341
    ArrayList<Long> list = generateIDList();
342
   
343
    mData = mMapNodeID.get(list);
344
   
345
    if( mData!=null )
346
      {
347
      mData.numPointingNodes++;
348
      }
349
    else
350
      {
351
      mData = new NodeData(++mNextNodeID);   
352
      mMapNodeID.put(list, mData);
353
      }
354
    }
355 c204c69d leszek
356 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
357
/**
358
 * Adds a new child to the last position in the list of our Node's children.
359 c204c69d leszek
 * <p>
360
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
361
 * DistortedAttachDeamon (by calling attachNow())
362
 *
363 6a06a912 Leszek Koltunski
 * @param node The new Node to add.
364
 */
365 c204c69d leszek
  public void attach(DistortedNode node)
366 6a06a912 Leszek Koltunski
    {
367 c204c69d leszek
    DistortedAttachDaemon.attach(this,node);
368 6a06a912 Leszek Koltunski
    }
369 c204c69d leszek
370 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
371
/**
372
 * Adds a new child to the last position in the list of our Node's children.
373 c204c69d leszek
 * <p>
374
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
375
 * DistortedAttachDeamon (by calling attachNow())
376
 *
377 c5369f1b leszek
 * @param surface InputSurface to initialize our child Node with.
378 07d8ef09 Leszek Koltunski
 * @param effects DistortedEffects to initialize our child Node with.
379 05403bba Leszek Koltunski
 * @param mesh MeshObject to initialize our child Node with.
380 6a06a912 Leszek Koltunski
 * @return the newly constructed child Node, or null if we couldn't allocate resources.
381
 */
382 c204c69d leszek
  public DistortedNode attach(DistortedInputSurface surface, DistortedEffects effects, MeshObject mesh)
383 6a06a912 Leszek Koltunski
    {
384 c204c69d leszek
    DistortedNode node = new DistortedNode(surface,effects,mesh);
385
    DistortedAttachDaemon.attach(this,node);
386
    return node;
387
    }
388 f8377ef8 leszek
389 c204c69d leszek
///////////////////////////////////////////////////////////////////////////////////////////////////
390
/**
391
 * This is not really part of the public API. Has to be public only because it is a part of the
392
 * DistortedAttacheable interface, which should really be a class that we extend here instead but
393
 * Java has no multiple inheritance.
394
 *
395
 * @param node The new Node to add.
396
 */
397
  public void attachNow(DistortedNode node)
398
    {
399 9361b337 Leszek Koltunski
    if( mChildren==null ) mChildren = new ArrayList<>(2);
400 c204c69d leszek
401 6a06a912 Leszek Koltunski
    mChildren.add(node);
402
    mNumChildren[0]++;
403
    }
404 c204c69d leszek
405 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
406
/**
407
 * Removes the first occurrence of a specified child from the list of children of our Node.
408 c204c69d leszek
 * <p>
409
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
410
 * DistortedAttachDeamon (by calling detachNow())
411
 *
412 6a06a912 Leszek Koltunski
 * @param node The Node to remove.
413
 */
414 c204c69d leszek
  public void detach(DistortedNode node)
415 6a06a912 Leszek Koltunski
    {
416 c204c69d leszek
    DistortedAttachDaemon.detach(this,node);
417 6a06a912 Leszek Koltunski
    }
418 a09ada4c Leszek Koltunski
419 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
420
/**
421
 * Removes the first occurrence of a specified child from the list of children of our Node.
422 a09ada4c Leszek Koltunski
 * <p>
423
 * A bit questionable method as there can be many different Nodes attached as children, some
424
 * of them having the same Effects but - for instance - different Mesh. Use with care.
425 c204c69d leszek
 * <p>
426
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
427
 * DistortedAttachDeamon (by calling detachNow())
428 a09ada4c Leszek Koltunski
 *
429 07d8ef09 Leszek Koltunski
 * @param effects DistortedEffects to remove.
430 6a06a912 Leszek Koltunski
 */
431 c204c69d leszek
  public void detach(DistortedEffects effects)
432 6a06a912 Leszek Koltunski
    {
433 07d8ef09 Leszek Koltunski
    long id = effects.getID();
434 a09ada4c Leszek Koltunski
    DistortedNode node;
435
436 6a06a912 Leszek Koltunski
    for(int i=0; i<mNumChildren[0]; i++)
437
      {
438
      node = mChildren.get(i);
439 a09ada4c Leszek Koltunski
440 07d8ef09 Leszek Koltunski
      if( node.mEffects.getID()==id )
441 6a06a912 Leszek Koltunski
        {
442 c204c69d leszek
        DistortedAttachDaemon.detach(this,node);
443
        break;
444 6a06a912 Leszek Koltunski
        }
445
      }
446
    }
447 a09ada4c Leszek Koltunski
448 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
449
/**
450 c204c69d leszek
 * This is not really part of the public API. Has to be public only because it is a part of the
451
 * DistortedAttacheable interface, which should really be a class that we extend here instead but
452
 * Java has no multiple inheritance.
453
 *
454
 * @param node The Node to remove.
455 6a06a912 Leszek Koltunski
 */
456 c204c69d leszek
  public void detachNow(DistortedNode node)
457 6a06a912 Leszek Koltunski
    {
458 c204c69d leszek
    if( mNumChildren[0]>0 && mChildren.remove(node) )
459 6a06a912 Leszek Koltunski
      {
460 c204c69d leszek
      mNumChildren[0]--;
461 6a06a912 Leszek Koltunski
      }
462 c204c69d leszek
    }
463
464
///////////////////////////////////////////////////////////////////////////////////////////////////
465
/**
466
 * Removes all children Nodes.
467
 * <p>
468
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
469
 * DistortedAttachDeamon (by calling detachAllNow())
470
 */
471
  public void detachAll()
472
    {
473
    DistortedAttachDaemon.detachAll(this);
474
    }
475
476
///////////////////////////////////////////////////////////////////////////////////////////////////
477
/**
478
 * This is not really part of the public API. Has to be public only because it is a part of the
479
 * DistortedAttacheable interface, which should really be a class that we extend here instead but
480
 * Java has no multiple inheritance.
481
 */
482
  public void detachAllNow()
483
    {
484 6a06a912 Leszek Koltunski
    if( mNumChildren[0]>0 )
485
      {
486
      mNumChildren[0] = 0;
487
      mChildren.clear();
488
      }
489
    }
490 d1e740c5 Leszek Koltunski
491 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
492
/**
493 421c2728 Leszek Koltunski
 * Returns the DistortedEffects object that's in the Node.
494 6a06a912 Leszek Koltunski
 * 
495 421c2728 Leszek Koltunski
 * @return The DistortedEffects contained in the Node.
496 6a06a912 Leszek Koltunski
 */
497 421c2728 Leszek Koltunski
  public DistortedEffects getEffects()
498 6a06a912 Leszek Koltunski
    {
499 07d8ef09 Leszek Koltunski
    return mEffects;
500 4e2382f3 Leszek Koltunski
    }
501
502
///////////////////////////////////////////////////////////////////////////////////////////////////
503
/**
504 c5369f1b leszek
 * Returns the DistortedInputSurface object that's in the Node.
505 4e2382f3 Leszek Koltunski
 *
506 c5369f1b leszek
 * @return The DistortedInputSurface contained in the Node.
507 4e2382f3 Leszek Koltunski
 */
508 c5369f1b leszek
  public DistortedInputSurface getSurface()
509 4e2382f3 Leszek Koltunski
    {
510 c5369f1b leszek
    return mSurface;
511 6a06a912 Leszek Koltunski
    }
512
513 8c327653 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
514
/**
515
 * Returns the DistortedFramebuffer object that's in the Node.
516
 *
517
 * @return The DistortedFramebuffer contained in the Node.
518
 */
519
  public DistortedFramebuffer getFramebuffer()
520
    {
521
    return mData.mFBO;
522
    }
523 6a06a912 Leszek Koltunski
524 8c327653 Leszek Koltunski
  }