Revision 226144d0
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/library/DistortedOutputSurface.java | ||
---|---|---|
77 | 77 |
|
78 | 78 |
mProjectionMatrix = new float[16]; |
79 | 79 |
|
80 |
mWidth = width; |
|
81 |
mHeight= height; |
|
82 |
|
|
83 | 80 |
mFOV = 60.0f; |
84 | 81 |
mNear= 0.5f; |
85 | 82 |
|
... | ... | |
181 | 178 |
|
182 | 179 |
for(int j=0; j<EffectQuality.LENGTH; j++) |
183 | 180 |
{ |
184 |
mBuffer1[j] = new DistortedFramebuffer( mDepthCreated!=DONT_CREATE, DistortedSurface.TYPE_SYST,
|
|
181 |
mBuffer1[j] = new DistortedFramebuffer( mDepthCreated!=DONT_CREATE, DistortedObject.TYPE_SYST,
|
|
185 | 182 |
(int)(mWidth*mipmap), (int)(mHeight*mipmap) ); |
186 |
mBuffer2[j] = new DistortedFramebuffer(false , DistortedSurface.TYPE_SYST,
|
|
183 |
mBuffer2[j] = new DistortedFramebuffer( false , DistortedObject.TYPE_SYST,
|
|
187 | 184 |
(int)(mWidth*mipmap), (int)(mHeight*mipmap) ); |
188 | 185 |
mBuffer1[j].mMipmap = mipmap; |
189 | 186 |
mipmap *= EffectQuality.MULTIPLIER; |
190 | 187 |
} |
191 |
DistortedSurface.toDo(); // create immediately
|
|
188 |
DistortedObject.toDo(); // create immediately
|
|
192 | 189 |
} |
193 | 190 |
|
194 | 191 |
numRenders += child.draw(time,mBuffer1[currP.getQuality()]); |
... | ... | |
260 | 257 |
/* |
261 | 258 |
if( changed2 ) |
262 | 259 |
{ |
263 |
DistortedSurface.debugLists(); |
|
264 |
} |
|
265 |
*/ |
|
266 |
// create and delete all Meshes (we need to create Vertex Buffer Objects) |
|
267 |
/* |
|
268 |
boolean changed3 = |
|
269 |
*/ |
|
270 |
MeshObject.toDo(); |
|
271 |
/* |
|
272 |
if( changed3 ) |
|
273 |
{ |
|
274 |
MeshObject.debugLists(); |
|
260 |
DistortedObject.debugLists(); |
|
275 | 261 |
} |
276 | 262 |
*/ |
277 | 263 |
// mark OpenGL state as unknown |
Also available in: Unified diff
Progress with VBOs - this time abstract out a new class, DistortedObject - i.e. everything that uploads something to GPU and thus needs to be auto re-created upon loss of the context.