[Bf-blender-cvs] [6fc9285] GPU_data_request: cleanup: redundant include & defines

Mike Erwin noreply at git.blender.org
Sat Mar 21 09:24:28 CET 2015


Commit: 6fc928599ba7d19e7e74d9f8b02617f952d7bdd5
Author: Mike Erwin
Date:   Sat Mar 21 04:23:29 2015 -0400
Branches: GPU_data_request
https://developer.blender.org/rB6fc928599ba7d19e7e74d9f8b02617f952d7bdd5

cleanup: redundant include & defines

GLEW takes care of this.

VAOs are not part of OpenGL 2.1 but are very widely supported. Even so
we should check before using. Current code does not check.

Also minor style things I missed in the previous commit.

===================================================================

M	source/blender/gpu/intern/gpux_vbo.c

===================================================================

diff --git a/source/blender/gpu/intern/gpux_vbo.c b/source/blender/gpu/intern/gpux_vbo.c
index ab0482d..22d8542 100644
--- a/source/blender/gpu/intern/gpux_vbo.c
+++ b/source/blender/gpu/intern/gpux_vbo.c
@@ -13,15 +13,6 @@
  * so we should follow that restriction on all platforms. */
 #define USE_VAO (USE_VBO && true)
 
-#if USE_VAO
-  #ifndef glGenVertexArrays
-    #include <OpenGL/glext.h>
-    #define glGenVertexArrays glGenVertexArraysAPPLE
-    #define glDeleteVertexArrays glDeleteVertexArraysAPPLE
-    #define glBindVertexArray glBindVertexArrayAPPLE
-  #endif
-#endif /* USE_VAO */
-
 #if TRUST_NO_ONE
   #include <assert.h>
 #endif /* TRUST_NO_ONE */
@@ -114,7 +105,7 @@ void attrib_print(const VertexBuffer *buff, unsigned attrib_num)
 
 	unsigned comp_size = comp_sz(a->comp_type);
 	for (unsigned v = 0; v < buff->vertex_ct; ++v) {
-		const void* data = (byte*)a->data + v * a->stride;
+		const void *data = (byte*)a->data + v * a->stride;
 		for (unsigned offset = 0; offset < a->sz; ++offset) {
 			if (offset % comp_size == 0)
 				putchar(' ');
@@ -144,7 +135,7 @@ void vertex_buffer_discard(VertexBuffer *buff)
 	for (unsigned a_idx = 0; a_idx < buff->attrib_ct; ++a_idx)
 	{
 		/* whatever needs doing */
-		Attrib* a = buff->attribs + a_idx;
+		Attrib *a = buff->attribs + a_idx;
 #if USE_VBO
 		if (a->vbo_id)
 			glDeleteBuffers(1, &a->vbo_id);
@@ -170,7 +161,7 @@ static unsigned attrib_total_size(const VertexBuffer *buff, unsigned attrib_num)
 	return (buff->vertex_ct - 1) * attrib->stride + attrib->sz;
 }
 
-void specify_attrib(VertexBuffer *buff, unsigned attrib_num, const char* name, GLenum comp_type, unsigned comp_ct, VertexFetchMode fetch_mode)
+void specify_attrib(VertexBuffer *buff, unsigned attrib_num, const char *name, GLenum comp_type, unsigned comp_ct, VertexFetchMode fetch_mode)
 {
 #if TRUST_NO_ONE
 	assert(attrib_num < buff->attrib_ct);




More information about the Bf-blender-cvs mailing list