Revision 9ecac8cd
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/library/main/DistortedNode.java | ||
---|---|---|
240 | 240 |
|
241 | 241 |
private DistortedFramebuffer allocateNewFBO() |
242 | 242 |
{ |
243 |
int width = mFboW <= 0 ? (int)mMesh.getStretchX() : mFboW; |
|
244 |
int height = mFboH <= 0 ? (int)mMesh.getStretchY() : mFboH; |
|
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 |
|
|
245 | 265 |
return new DistortedFramebuffer(1,mFboDepthStencil, InternalSurface.TYPE_TREE, width, height); |
246 | 266 |
} |
247 | 267 |
|
... | ... | |
491 | 511 |
/** |
492 | 512 |
* Resizes the DistortedFramebuffer object that we render this Node to. |
493 | 513 |
*/ |
494 |
public void resize(int width, int height) |
|
514 |
public void resizeFBO(int width, int height)
|
|
495 | 515 |
{ |
496 | 516 |
mFboW = width; |
497 | 517 |
mFboH = height; |
src/main/java/org/distorted/library/main/DistortedScreen.java | ||
---|---|---|
68 | 68 |
/** |
69 | 69 |
* Create a new Screen. Initially 1x1 in size. |
70 | 70 |
* <p> |
71 |
* Has to be followed by a 'resize()' to set the size. |
|
71 |
* Has to be followed by a 'resizeFBO()' to set the size.
|
|
72 | 72 |
*/ |
73 | 73 |
public DistortedScreen() |
74 | 74 |
{ |
Also available in: Unified diff
Size of the FBO internal to Nodes is now NO MORE taken from the Mesh's stretch values.
Instead, the size is copied from child's FBO size (if there is one) or if the child is a leaf with texture in it (which is sizeless) then we get the default 100x100 ( which means we probably have to explicitly call Node.resizeFBO() )