| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 479f53b commit 539e62f
15 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -145,19 +145,19 @@ public class FrameBuffer implements PConstants { | |||
| 145 | 145 | protected void finalize() throws Throwable { | |
| 146 | 146 | try { | |
| 147 | 147 | if (glFbo != 0) { | |
| 148 | - pg.finalizeFrameBufferObject(glFbo, context.code()); | ||
| 148 | + pg.finalizeFrameBufferObject(glFbo, context.id()); | ||
| 149 | 149 | } | |
| 150 | 150 | if (glDepth != 0) { | |
| 151 | - pg.finalizeRenderBufferObject(glDepth, context.code()); | ||
| 151 | + pg.finalizeRenderBufferObject(glDepth, context.id()); | ||
| 152 | 152 | } | |
| 153 | 153 | if (glStencil != 0) { | |
| 154 | - pg.finalizeRenderBufferObject(glStencil, context.code()); | ||
| 154 | + pg.finalizeRenderBufferObject(glStencil, context.id()); | ||
| 155 | 155 | } | |
| 156 | 156 | if (glMultisample != 0) { | |
| 157 | - pg.finalizeRenderBufferObject(glMultisample, context.code()); | ||
| 157 | + pg.finalizeRenderBufferObject(glMultisample, context.id()); | ||
| 158 | 158 | } | |
| 159 | 159 | if (glDepthStencil != 0) { | |
| 160 | - pg.finalizeRenderBufferObject(glDepthStencil, context.code()); | ||
| 160 | + pg.finalizeRenderBufferObject(glDepthStencil, context.id()); | ||
| 161 | 161 | } | |
| 162 | 162 | } finally { | |
| 163 | 163 | super.finalize(); | |
@@ -290,7 +290,7 @@ protected void allocate() { | |||
| 290 | 290 | if (screenFb) { | |
| 291 | 291 | glFbo = 0; | |
| 292 | 292 | } else { | |
| 293 | - glFbo = pg.createFrameBufferObject(context.code()); | ||
| 293 | + glFbo = pg.createFrameBufferObject(context.id()); | ||
| 294 | 294 | } | |
| 295 | 295 | ||
| 296 | 296 | // create the rest of the stuff... | |
@@ -313,23 +313,23 @@ protected void allocate() { | |||
| 313 | 313 | ||
| 314 | 314 | protected void release() { | |
| 315 | 315 | if (glFbo != 0) { | |
| 316 | - pg.finalizeFrameBufferObject(glFbo, context.code()); | ||
| 316 | + pg.finalizeFrameBufferObject(glFbo, context.id()); | ||
| 317 | 317 | glFbo = 0; | |
| 318 | 318 | } | |
| 319 | 319 | if (glDepth != 0) { | |
| 320 | - pg.finalizeRenderBufferObject(glDepth, context.code()); | ||
| 320 | + pg.finalizeRenderBufferObject(glDepth, context.id()); | ||
| 321 | 321 | glDepth = 0; | |
| 322 | 322 | } | |
| 323 | 323 | if (glStencil != 0) { | |
| 324 | - pg.finalizeRenderBufferObject(glStencil, context.code()); | ||
| 324 | + pg.finalizeRenderBufferObject(glStencil, context.id()); | ||
| 325 | 325 | glStencil = 0; | |
| 326 | 326 | } | |
| 327 | 327 | if (glMultisample != 0) { | |
| 328 | - pg.finalizeRenderBufferObject(glMultisample, context.code()); | ||
| 328 | + pg.finalizeRenderBufferObject(glMultisample, context.id()); | ||
| 329 | 329 | glMultisample = 0; | |
| 330 | 330 | } | |
| 331 | 331 | if (glDepthStencil != 0) { | |
| 332 | - pg.finalizeRenderBufferObject(glDepthStencil, context.code()); | ||
| 332 | + pg.finalizeRenderBufferObject(glDepthStencil, context.id()); | ||
| 333 | 333 | glDepthStencil = 0; | |
| 334 | 334 | } | |
| 335 | 335 | } | |
@@ -338,11 +338,11 @@ protected void release() { | |||
| 338 | 338 | protected boolean contextIsOutdated() { | |
| 339 | 339 | boolean outdated = !pgl.contextIsCurrent(context); | |
| 340 | 340 | if (outdated) { | |
| 341 | - pg.removeFrameBufferObject(glFbo, context.code()); | ||
| 342 | - pg.removeRenderBufferObject(glDepth, context.code()); | ||
| 343 | - pg.removeRenderBufferObject(glStencil, context.code()); | ||
| 344 | - pg.removeRenderBufferObject(glDepthStencil, context.code()); | ||
| 345 | - pg.removeRenderBufferObject(glMultisample, context.code()); | ||
| 341 | + pg.removeFrameBufferObject(glFbo, context.id()); | ||
| 342 | + pg.removeRenderBufferObject(glDepth, context.id()); | ||
| 343 | + pg.removeRenderBufferObject(glStencil, context.id()); | ||
| 344 | + pg.removeRenderBufferObject(glDepthStencil, context.id()); | ||
| 345 | + pg.removeRenderBufferObject(glMultisample, context.id()); | ||
| 346 | 346 | ||
| 347 | 347 | glFbo = 0; | |
| 348 | 348 | glDepth = 0; | |
@@ -364,7 +364,7 @@ protected void createColorBufferMultisample() { | |||
| 364 | 364 | pg.pushFramebuffer(); | |
| 365 | 365 | pg.setFramebuffer(this); | |
| 366 | 366 | ||
| 367 | - glMultisample = pg.createRenderBufferObject(context.code()); | ||
| 367 | + glMultisample = pg.createRenderBufferObject(context.id()); | ||
| 368 | 368 | pgl.bindRenderbuffer(PGL.RENDERBUFFER, glMultisample); | |
| 369 | 369 | pgl.renderbufferStorageMultisample(PGL.RENDERBUFFER, nsamples, | |
| 370 | 370 | PGL.RGBA8, width, height); | |
@@ -385,7 +385,7 @@ protected void createPackedDepthStencilBuffer() { | |||
| 385 | 385 | pg.pushFramebuffer(); | |
| 386 | 386 | pg.setFramebuffer(this); | |
| 387 | 387 | ||
| 388 | - glDepthStencil = pg.createRenderBufferObject(context.code()); | ||
| 388 | + glDepthStencil = pg.createRenderBufferObject(context.id()); | ||
| 389 | 389 | pgl.bindRenderbuffer(PGL.RENDERBUFFER, glDepthStencil); | |
| 390 | 390 | ||
| 391 | 391 | if (multisample) { | |
@@ -415,7 +415,7 @@ protected void createDepthBuffer() { | |||
| 415 | 415 | pg.pushFramebuffer(); | |
| 416 | 416 | pg.setFramebuffer(this); | |
| 417 | 417 | ||
| 418 | - glDepth = pg.createRenderBufferObject(context.code()); | ||
| 418 | + glDepth = pg.createRenderBufferObject(context.id()); | ||
| 419 | 419 | pgl.bindRenderbuffer(PGL.RENDERBUFFER, glDepth); | |
| 420 | 420 | ||
| 421 | 421 | int glConst = PGL.DEPTH_COMPONENT16; | |
@@ -451,7 +451,7 @@ protected void createStencilBuffer() { | |||
| 451 | 451 | pg.pushFramebuffer(); | |
| 452 | 452 | pg.setFramebuffer(this); | |
| 453 | 453 | ||
| 454 | - glStencil = pg.createRenderBufferObject(context.code()); | ||
| 454 | + glStencil = pg.createRenderBufferObject(context.id()); | ||
| 455 | 455 | pgl.bindRenderbuffer(PGL.RENDERBUFFER, glStencil); | |
| 456 | 456 | ||
| 457 | 457 | int glConst = PGL.STENCIL_INDEX1; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -249,7 +249,7 @@ public boolean contextIsOutdated() { | |||
| 249 | 249 | } | |
| 250 | 250 | if (outdated) { | |
| 251 | 251 | for (int i = 0; i < textures.length; i++) { | |
| 252 | - pg.removeTextureObject(textures[i].glName, textures[i].context.code()); | ||
| 252 | + pg.removeTextureObject(textures[i].glName, textures[i].context.id()); | ||
| 253 | 253 | textures[i].glName = 0; | |
| 254 | 254 | } | |
| 255 | 255 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -318,6 +318,9 @@ public class PGL { | |||
| 318 | 318 | ||
| 319 | 319 | /** GLU interface **/ | |
| 320 | 320 | public PGLU glu; | |
| 321 | + | ||
| 322 | + /** The current opengl context */ | ||
| 323 | + static public EGLContext context; | ||
| 321 | 324 | ||
| 322 | 325 | /** The PGraphics object using this interface */ | |
| 323 | 326 | protected PGraphicsOpenGL pg; | |
@@ -328,7 +331,7 @@ public class PGL { | |||
| 328 | 331 | /** The renderer object driving the rendering loop, | |
| 329 | 332 | * analogous to the GLEventListener in JOGL */ | |
| 330 | 333 | protected AndroidRenderer renderer; | |
| 331 | - | ||
| 334 | + | ||
| 332 | 335 | /** Which texturing targets are enabled */ | |
| 333 | 336 | protected static boolean[] texturingTargets = { false }; | |
| 334 | 337 | ||
@@ -1284,25 +1287,41 @@ protected Context createEmptyContext() { | |||
| 1284 | 1287 | ||
| 1285 | 1288 | ||
| 1286 | 1289 | protected Context getCurrentContext() { | |
| 1287 | - return new Context(); | ||
| 1290 | + return new Context(context); | ||
| 1288 | 1291 | } | |
| 1289 | 1292 | ||
| 1290 | 1293 | ||
| 1291 | 1294 | protected class Context { | |
| 1295 | + protected int id; | ||
| 1292 | 1296 | ||
| 1293 | - Context() { | ||
| 1297 | + Context() { | ||
| 1298 | + id = -1; | ||
| 1294 | 1299 | } | |
| 1295 | - | ||
| 1300 | + | ||
| 1301 | + Context(EGLContext context) { | ||
| 1302 | + if (context != null) { | ||
| 1303 | + id = context.hashCode(); | ||
| 1304 | + } else { | ||
| 1305 | + id = -1; | ||
| 1306 | + } | ||
| 1307 | + } | ||
| 1308 | + | ||
| 1296 | 1309 | boolean current() { | |
| 1297 | - return true; | ||
| 1298 | - } | ||
| 1299 | - | ||
| 1300 | - boolean equal() { | ||
| 1301 | - return true; | ||
| 1310 | + return equal(context); | ||
| 1302 | 1311 | } | |
| 1303 | - | ||
| 1304 | - int code() { | ||
| 1305 | - return 0; | ||
| 1312 | + | ||
| 1313 | + boolean equal(EGLContext context) { | ||
| 1314 | + if (id == -1 || context == null) { | ||
| 1315 | + // A null context means a still non-created resource, | ||
| 1316 | + // so it is considered equal to the argument. | ||
| 1317 | + return true; | ||
| 1318 | + } else { | ||
| 1319 | + return id == context.hashCode(); | ||
| 1320 | + } | ||
| 1321 | + } | ||
| 1322 | + | ||
| 1323 | + int id() { | ||
| 1324 | + return id; | ||
| 1306 | 1325 | } | |
| 1307 | 1326 | } | |
| 1308 | 1327 | ||
@@ -2035,6 +2054,7 @@ public void onSurfaceChanged(GL10 igl, int iwidth, int iheight) { | |||
| 2035 | 2054 | ||
| 2036 | 2055 | public void onSurfaceCreated(GL10 igl, EGLConfig config) { | |
| 2037 | 2056 | gl = igl; | |
| 2057 | + context = ((EGL10)EGLContext.getEGL()).eglGetCurrentContext(); | ||
| 2038 | 2058 | } | |
| 2039 | 2059 | } | |
| 2040 | 2060 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1153,45 +1153,45 @@ protected void createPolyBuffers() { | |||
| 1153 | 1153 | int sizei = INIT_VERTEX_BUFFER_SIZE * PGL.SIZEOF_INT; | |
| 1154 | 1154 | int sizex = INIT_INDEX_BUFFER_SIZE * PGL.SIZEOF_INDEX; | |
| 1155 | 1155 | ||
| 1156 | - glPolyVertex = createVertexBufferObject(polyBuffersContext.code()); | ||
| 1156 | + glPolyVertex = createVertexBufferObject(polyBuffersContext.id()); | ||
| 1157 | 1157 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyVertex); | |
| 1158 | 1158 | pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef, null, PGL.STATIC_DRAW); | |
| 1159 | 1159 | ||
| 1160 | - glPolyColor = createVertexBufferObject(polyBuffersContext.code()); | ||
| 1160 | + glPolyColor = createVertexBufferObject(polyBuffersContext.id()); | ||
| 1161 | 1161 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyColor); | |
| 1162 | 1162 | pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW); | |
| 1163 | 1163 | ||
| 1164 | - glPolyNormal = createVertexBufferObject(polyBuffersContext.code()); | ||
| 1164 | + glPolyNormal = createVertexBufferObject(polyBuffersContext.id()); | ||
| 1165 | 1165 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyNormal); | |
| 1166 | 1166 | pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef, null, PGL.STATIC_DRAW); | |
| 1167 | 1167 | ||
| 1168 | - glPolyTexcoord = createVertexBufferObject(polyBuffersContext.code()); | ||
| 1168 | + glPolyTexcoord = createVertexBufferObject(polyBuffersContext.id()); | ||
| 1169 | 1169 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyTexcoord); | |
| 1170 | 1170 | pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef, null, PGL.STATIC_DRAW); | |
| 1171 | 1171 | ||
| 1172 | 1172 | glPolyAmbient = pgPrimary.createVertexBufferObject( | |
| 1173 | - polyBuffersContext.code()); | ||
| 1173 | + polyBuffersContext.id()); | ||
| 1174 | 1174 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyAmbient); | |
| 1175 | 1175 | pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW); | |
| 1176 | 1176 | ||
| 1177 | 1177 | glPolySpecular = pgPrimary.createVertexBufferObject( | |
| 1178 | - polyBuffersContext.code()); | ||
| 1178 | + polyBuffersContext.id()); | ||
| 1179 | 1179 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolySpecular); | |
| 1180 | 1180 | pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW); | |
| 1181 | 1181 | ||
| 1182 | 1182 | glPolyEmissive = pgPrimary.createVertexBufferObject( | |
| 1183 | - polyBuffersContext.code()); | ||
| 1183 | + polyBuffersContext.id()); | ||
| 1184 | 1184 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyEmissive); | |
| 1185 | 1185 | pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW); | |
| 1186 | 1186 | ||
| 1187 | 1187 | glPolyShininess = pgPrimary.createVertexBufferObject( | |
| 1188 | - polyBuffersContext.code()); | ||
| 1188 | + polyBuffersContext.id()); | ||
| 1189 | 1189 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyShininess); | |
| 1190 | 1190 | pgl.bufferData(PGL.ARRAY_BUFFER, sizef, null, PGL.STATIC_DRAW); | |
| 1191 | 1191 | ||
| 1192 | 1192 | pgl.bindBuffer(PGL.ARRAY_BUFFER, 0); | |
| 1193 | 1193 | ||
| 1194 | - glPolyIndex = createVertexBufferObject(polyBuffersContext.code()); | ||
| 1194 | + glPolyIndex = createVertexBufferObject(polyBuffersContext.id()); | ||
| 1195 | 1195 | pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPolyIndex); | |
| 1196 | 1196 | pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER, sizex, null, PGL.STATIC_DRAW); | |
| 1197 | 1197 | ||
@@ -1266,31 +1266,31 @@ protected boolean polyBuffersContextIsOutdated() { | |||
| 1266 | 1266 | ||
| 1267 | 1267 | protected void deletePolyBuffers() { | |
| 1268 | 1268 | if (polyBuffersCreated) { | |
| 1269 | - deleteVertexBufferObject(glPolyVertex, polyBuffersContext.code()); | ||
| 1269 | + deleteVertexBufferObject(glPolyVertex, polyBuffersContext.id()); | ||
| 1270 | 1270 | glPolyVertex = 0; | |
| 1271 | 1271 | ||
| 1272 | - deleteVertexBufferObject(glPolyColor, polyBuffersContext.code()); | ||
| 1272 | + deleteVertexBufferObject(glPolyColor, polyBuffersContext.id()); | ||
| 1273 | 1273 | glPolyColor = 0; | |
| 1274 | 1274 | ||
| 1275 | - deleteVertexBufferObject(glPolyNormal, polyBuffersContext.code()); | ||
| 1275 | + deleteVertexBufferObject(glPolyNormal, polyBuffersContext.id()); | ||
| 1276 | 1276 | glPolyNormal = 0; | |
| 1277 | 1277 | ||
| 1278 | - deleteVertexBufferObject(glPolyTexcoord, polyBuffersContext.code()); | ||
| 1278 | + deleteVertexBufferObject(glPolyTexcoord, polyBuffersContext.id()); | ||
| 1279 | 1279 | glPolyTexcoord = 0; | |
| 1280 | 1280 | ||
| 1281 | - deleteVertexBufferObject(glPolyAmbient, polyBuffersContext.code()); | ||
| 1281 | + deleteVertexBufferObject(glPolyAmbient, polyBuffersContext.id()); | ||
| 1282 | 1282 | glPolyAmbient = 0; | |
| 1283 | 1283 | ||
| 1284 | - deleteVertexBufferObject(glPolySpecular, polyBuffersContext.code()); | ||
| 1284 | + deleteVertexBufferObject(glPolySpecular, polyBuffersContext.id()); | ||
| 1285 | 1285 | glPolySpecular = 0; | |
| 1286 | 1286 | ||
| 1287 | - deleteVertexBufferObject(glPolyEmissive, polyBuffersContext.code()); | ||
| 1287 | + deleteVertexBufferObject(glPolyEmissive, polyBuffersContext.id()); | ||
| 1288 | 1288 | glPolyEmissive = 0; | |
| 1289 | 1289 | ||
| 1290 | - deleteVertexBufferObject(glPolyShininess, polyBuffersContext.code()); | ||
| 1290 | + deleteVertexBufferObject(glPolyShininess, polyBuffersContext.id()); | ||
| 1291 | 1291 | glPolyShininess = 0; | |
| 1292 | 1292 | ||
| 1293 | - deleteVertexBufferObject(glPolyIndex, polyBuffersContext.code()); | ||
| 1293 | + deleteVertexBufferObject(glPolyIndex, polyBuffersContext.id()); | ||
| 1294 | 1294 | glPolyIndex = 0; | |
| 1295 | 1295 | ||
| 1296 | 1296 | polyBuffersCreated = false; | |
@@ -1306,22 +1306,22 @@ protected void createLineBuffers() { | |||
| 1306 | 1306 | int sizei = INIT_VERTEX_BUFFER_SIZE * PGL.SIZEOF_INT; | |
| 1307 | 1307 | int sizex = INIT_INDEX_BUFFER_SIZE * PGL.SIZEOF_INDEX; | |
| 1308 | 1308 | ||
| 1309 | - glLineVertex = createVertexBufferObject(lineBuffersContext.code()); | ||
| 1309 | + glLineVertex = createVertexBufferObject(lineBuffersContext.id()); | ||
| 1310 | 1310 | ||
| 1311 | 1311 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineVertex); | |
| 1312 | 1312 | pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef, null, PGL.STATIC_DRAW); | |
| 1313 | 1313 | ||
| 1314 | - glLineColor = createVertexBufferObject(lineBuffersContext.code()); | ||
| 1314 | + glLineColor = createVertexBufferObject(lineBuffersContext.id()); | ||
| 1315 | 1315 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineColor); | |
| 1316 | 1316 | pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW); | |
| 1317 | 1317 | ||
| 1318 | - glLineAttrib = createVertexBufferObject(lineBuffersContext.code()); | ||
| 1318 | + glLineAttrib = createVertexBufferObject(lineBuffersContext.id()); | ||
| 1319 | 1319 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineAttrib); | |
| 1320 | 1320 | pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef, null, PGL.STATIC_DRAW); | |
| 1321 | 1321 | ||
| 1322 | 1322 | pgl.bindBuffer(PGL.ARRAY_BUFFER, 0); | |
| 1323 | 1323 | ||
| 1324 | - glLineIndex = createVertexBufferObject(lineBuffersContext.code()); | ||
| 1324 | + glLineIndex = createVertexBufferObject(lineBuffersContext.id()); | ||
| 1325 | 1325 | pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glLineIndex); | |
| 1326 | 1326 | pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER, sizex, null, PGL.STATIC_DRAW); | |
| 1327 | 1327 | ||
@@ -1372,16 +1372,16 @@ protected boolean lineBufferContextIsOutdated() { | |||
| 1372 | 1372 | ||
| 1373 | 1373 | protected void deleteLineBuffers() { | |
| 1374 | 1374 | if (lineBuffersCreated) { | |
| 1375 | - deleteVertexBufferObject(glLineVertex, lineBuffersContext.code()); | ||
| 1375 | + deleteVertexBufferObject(glLineVertex, lineBuffersContext.id()); | ||
| 1376 | 1376 | glLineVertex = 0; | |
| 1377 | 1377 | ||
| 1378 | - deleteVertexBufferObject(glLineColor, lineBuffersContext.code()); | ||
| 1378 | + deleteVertexBufferObject(glLineColor, lineBuffersContext.id()); | ||
| 1379 | 1379 | glLineColor = 0; | |
| 1380 | 1380 | ||
| 1381 | - deleteVertexBufferObject(glLineAttrib, lineBuffersContext.code()); | ||
| 1381 | + deleteVertexBufferObject(glLineAttrib, lineBuffersContext.id()); | ||
| 1382 | 1382 | glLineAttrib = 0; | |
| 1383 | 1383 | ||
| 1384 | - deleteVertexBufferObject(glLineIndex, lineBuffersContext.code()); | ||
| 1384 | + deleteVertexBufferObject(glLineIndex, lineBuffersContext.id()); | ||
| 1385 | 1385 | glLineIndex = 0; | |
| 1386 | 1386 | ||
| 1387 | 1387 | lineBuffersCreated = false; | |
@@ -1397,21 +1397,21 @@ protected void createPointBuffers() { | |||
| 1397 | 1397 | int sizei = INIT_VERTEX_BUFFER_SIZE * PGL.SIZEOF_INT; | |
| 1398 | 1398 | int sizex = INIT_INDEX_BUFFER_SIZE * PGL.SIZEOF_INDEX; | |
| 1399 | 1399 | ||
| 1400 | - glPointVertex = createVertexBufferObject(pointBuffersContext.code()); | ||
| 1400 | + glPointVertex = createVertexBufferObject(pointBuffersContext.id()); | ||
| 1401 | 1401 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointVertex); | |
| 1402 | 1402 | pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef, null, PGL.STATIC_DRAW); | |
| 1403 | 1403 | ||
| 1404 | - glPointColor = createVertexBufferObject(pointBuffersContext.code()); | ||
| 1404 | + glPointColor = createVertexBufferObject(pointBuffersContext.id()); | ||
| 1405 | 1405 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointColor); | |
| 1406 | 1406 | pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW); | |
| 1407 | 1407 | ||
| 1408 | - glPointAttrib = createVertexBufferObject(pointBuffersContext.code()); | ||
| 1408 | + glPointAttrib = createVertexBufferObject(pointBuffersContext.id()); | ||
| 1409 | 1409 | pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointAttrib); | |
| 1410 | 1410 | pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef, null, PGL.STATIC_DRAW); | |
| 1411 | 1411 | ||
| 1412 | 1412 | pgl.bindBuffer(PGL.ARRAY_BUFFER, 0); | |
| 1413 | 1413 | ||
| 1414 | - glPointIndex = createVertexBufferObject(pointBuffersContext.code()); | ||
| 1414 | + glPointIndex = createVertexBufferObject(pointBuffersContext.id()); | ||
| 1415 | 1415 | pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPointIndex); | |
| 1416 | 1416 | pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER, sizex, null, PGL.STATIC_DRAW); | |
| 1417 | 1417 | ||
@@ -1462,16 +1462,16 @@ protected boolean pointBuffersContextIsOutdated() { | |||
| 1462 | 1462 | ||
| 1463 | 1463 | protected void deletePointBuffers() { | |
| 1464 | 1464 | if (pointBuffersCreated) { | |
| 1465 | - deleteVertexBufferObject(glPointVertex, pointBuffersContext.code()); | ||
| 1465 | + deleteVertexBufferObject(glPointVertex, pointBuffersContext.id()); | ||
| 1466 | 1466 | glPointVertex = 0; | |
| 1467 | 1467 | ||
| 1468 | - deleteVertexBufferObject(glPointColor, pointBuffersContext.code()); | ||
| 1468 | + deleteVertexBufferObject(glPointColor, pointBuffersContext.id()); | ||
| 1469 | 1469 | glPointColor = 0; | |
| 1470 | 1470 | ||
| 1471 | - deleteVertexBufferObject(glPointAttrib, pointBuffersContext.code()); | ||
| 1471 | + deleteVertexBufferObject(glPointAttrib, pointBuffersContext.id()); | ||
| 1472 | 1472 | glPointAttrib = 0; | |
| 1473 | 1473 | ||
| 1474 | - deleteVertexBufferObject(glPointIndex, pointBuffersContext.code()); | ||
| 1474 | + deleteVertexBufferObject(glPointIndex, pointBuffersContext.id()); | ||
| 1475 | 1475 | glPointIndex = 0; | |
| 1476 | 1476 | ||
| 1477 | 1477 | pointBuffersCreated = false; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments