OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 gl_primitive_type = GL_TRIANGLE_FAN; | 243 gl_primitive_type = GL_TRIANGLE_FAN; |
244 break; | 244 break; |
245 } | 245 } |
246 default : { | 246 default : { |
247 DLOG(ERROR) << "Unknown Primitive Type in Primitive: " | 247 DLOG(ERROR) << "Unknown Primitive Type in Primitive: " |
248 << primitive_type_; | 248 << primitive_type_; |
249 draw = false; | 249 draw = false; |
250 } | 250 } |
251 } | 251 } |
252 if (draw) { | 252 if (draw) { |
253 DCHECK_NE(gl_primitive_type, GL_NONE); | 253 DCHECK_NE(gl_primitive_type, static_cast<unsigned int>(GL_NONE)); |
254 renderer->AddPrimitivesRendered(number_primitives_); | 254 renderer->AddPrimitivesRendered(number_primitives_); |
255 if (indexed()) | 255 if (indexed()) |
256 glDrawElements(gl_primitive_type, | 256 glDrawElements(gl_primitive_type, |
257 index_count, | 257 index_count, |
258 GL_UNSIGNED_INT, | 258 GL_UNSIGNED_INT, |
259 BUFFER_OFFSET(start_index() * sizeof(uint32))); // NOLINT | 259 BUFFER_OFFSET(start_index() * sizeof(uint32))); // NOLINT |
260 else | 260 else |
261 glDrawArrays(gl_primitive_type, start_index(), index_count); | 261 glDrawArrays(gl_primitive_type, start_index(), index_count); |
262 } | 262 } |
263 | 263 |
264 // Clean up the shaders. | 264 // Clean up the shaders. |
265 effect_gl->PostDraw(param_cache_gl); | 265 effect_gl->PostDraw(param_cache_gl); |
266 | 266 |
267 // Disable the vertex attribute states set earlier. | 267 // Disable the vertex attribute states set earlier. |
268 for (ParamCacheGL::VaryingParameterMap::iterator i = varying_map.begin(); | 268 for (ParamCacheGL::VaryingParameterMap::iterator i = varying_map.begin(); |
269 i != varying_map.end(); | 269 i != varying_map.end(); |
270 ++i) { | 270 ++i) { |
271 cgGLDisableClientState(i->first); | 271 cgGLDisableClientState(i->first); |
272 } | 272 } |
273 CHECK_GL_ERROR(); | 273 CHECK_GL_ERROR(); |
274 } | 274 } |
275 | 275 |
276 } // namespace o3d | 276 } // namespace o3d |
OLD | NEW |