()
| 2244 | |
| 2245 | |
| 2246 | @Override |
| 2247 | public void flush() { |
| 2248 | boolean hasPolys = 0 < tessGeo.polyVertexCount && |
| 2249 | 0 < tessGeo.polyIndexCount; |
| 2250 | boolean hasLines = 0 < tessGeo.lineVertexCount && |
| 2251 | 0 < tessGeo.lineIndexCount; |
| 2252 | boolean hasPoints = 0 < tessGeo.pointVertexCount && |
| 2253 | 0 < tessGeo.pointIndexCount; |
| 2254 | |
| 2255 | boolean hasPixels = modified && pixels != null; |
| 2256 | |
| 2257 | if (hasPixels) { |
| 2258 | // If the user has been manipulating individual pixels, |
| 2259 | // the changes need to be copied to the screen before |
| 2260 | // drawing any new geometry. |
| 2261 | flushPixels(); |
| 2262 | } |
| 2263 | |
| 2264 | if (hasPoints || hasLines || hasPolys) { |
| 2265 | PMatrix3D modelview0 = null; |
| 2266 | PMatrix3D modelviewInv0 = null; |
| 2267 | if (flushMode == FLUSH_WHEN_FULL) { |
| 2268 | // The modelview transformation has been applied already to the |
| 2269 | // tessellated vertices, so we set the OpenGL modelview matrix as |
| 2270 | // the identity to avoid applying the model transformations twice. |
| 2271 | // We save the modelview objects and temporarily use the identity |
| 2272 | // static matrix to avoid calling pushMatrix(), resetMatrix(), |
| 2273 | // popMatrix(). |
| 2274 | modelview0 = modelview; |
| 2275 | modelviewInv0 = modelviewInv; |
| 2276 | modelview = modelviewInv = identity; |
| 2277 | projmodelview.set(projection); |
| 2278 | } |
| 2279 | |
| 2280 | if (hasPolys && !isDepthSortingEnabled) { |
| 2281 | flushPolys(); |
| 2282 | if (raw != null) { |
| 2283 | rawPolys(); |
| 2284 | } |
| 2285 | } |
| 2286 | |
| 2287 | if (is3D()) { |
| 2288 | if (hasLines) { |
| 2289 | flushLines(); |
| 2290 | if (raw != null) { |
| 2291 | rawLines(); |
| 2292 | } |
| 2293 | } |
| 2294 | |
| 2295 | if (hasPoints) { |
| 2296 | flushPoints(); |
| 2297 | if (raw != null) { |
| 2298 | rawPoints(); |
| 2299 | } |
| 2300 | } |
| 2301 | } |
| 2302 | |
| 2303 | if (hasPolys && isDepthSortingEnabled) { |
no test coverage detected