[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48546] branches/soc-2012-swiss_cheese/ source/blender/gpu: We need "extern" to use GPU_functions outside of gpu module because they are actually variables .
Alexander Kuznetsov
kuzsasha at gmail.com
Tue Jul 3 17:27:29 CEST 2012
Revision: 48546
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48546
Author: alexk
Date: 2012-07-03 15:27:27 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
We need "extern" to use GPU_functions outside of gpu module because they are actually variables.
Modified Paths:
--------------
branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_functions.c
Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h 2012-07-03 15:14:14 UTC (rev 48545)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h 2012-07-03 15:27:27 UTC (rev 48546)
@@ -32,6 +32,11 @@
#include "intern/gpu_immediate.h" /* XXX: temporary, will re-factor header files later */
+#ifndef GPU_FUNC_INTERN
+#define GPUFUNC extern
+#else
+#define GPUFUNC
+#endif
#undef GLAPIENTRY /* glew.h was included above, so GLAPIENTRY is defined, but blank */
@@ -184,49 +189,47 @@
extern "C" {
#endif
+GPUFUNC GLuint (GLAPIENTRY* gpuCreateShader)(GLuint shaderType);
+GPUFUNC void (GLAPIENTRY* gpuAttachShader)(GLuint program, GLuint shader);
+GPUFUNC void (GLAPIENTRY* gpuShaderSource)(GLuint shader, GLint count, const GLchar ** string, const GLint * length);
+GPUFUNC void (GLAPIENTRY* gpuCompileShader)(GLuint shader);
+GPUFUNC void (* gpuGetShaderiv)(GLuint shader, GLuint pname, GLint *params);
+GPUFUNC void (GLAPIENTRY* gpuGetShaderInfoLog)(GLuint shader, GLint maxLength, GLint *length, GLchar *infoLog);
-GLuint (GLAPIENTRY* gpuCreateShader)(GLuint shaderType);
-void (GLAPIENTRY* gpuAttachShader)(GLuint program, GLuint shader);
-void (GLAPIENTRY* gpuShaderSource)(GLuint shader, GLint count, const GLchar ** string, const GLint * length);
-void (GLAPIENTRY* gpuCompileShader)(GLuint shader);
-void (* gpuGetShaderiv)(GLuint shader, GLuint pname, GLint *params);
-void (GLAPIENTRY* gpuGetShaderInfoLog)(GLuint shader, GLint maxLength, GLint *length, GLchar *infoLog);
+GPUFUNC GLuint (GLAPIENTRY* gpuCreateProgram)(void);
+GPUFUNC void (GLAPIENTRY* gpuLinkProgram)(GLuint program);
+GPUFUNC void (* gpuGetProgramiv)(GLuint shader, GLuint pname, GLint *params);
+GPUFUNC void (GLAPIENTRY* gpuGetProgramInfoLog)(GLuint shader, GLint maxLength, GLint *length, GLchar *infoLog);
-GLuint (GLAPIENTRY* gpuCreateProgram)(void);
-void (GLAPIENTRY* gpuLinkProgram)(GLuint program);
-void (* gpuGetProgramiv)(GLuint shader, GLuint pname, GLint *params);
-void (GLAPIENTRY* gpuGetProgramInfoLog)(GLuint shader, GLint maxLength, GLint *length, GLchar *infoLog);
+GPUFUNC void (GLAPIENTRY* gpuUniform1i)(GLint location, GLint v0);
-void (GLAPIENTRY* gpuUniform1i)(GLint location, GLint v0);
+GPUFUNC void (GLAPIENTRY* gpuUniform1fv)(GLint location, GLint count, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpuUniform2fv)(GLint location, GLint count, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpuUniform3fv)(GLint location, GLint count, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpuUniform4fv)(GLint location, GLint count, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpuUniformMatrix3fv)(GLint location, GLint count, GLboolean transpose, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpuUniformMatrix4fv)(GLint location, GLint count, GLboolean transpose, const GLfloat * value);
-void (GLAPIENTRY* gpuUniform1fv)(GLint location, GLint count, const GLfloat * value);
-void (GLAPIENTRY* gpuUniform2fv)(GLint location, GLint count, const GLfloat * value);
-void (GLAPIENTRY* gpuUniform3fv)(GLint location, GLint count, const GLfloat * value);
-void (GLAPIENTRY* gpuUniform4fv)(GLint location, GLint count, const GLfloat * value);
-void (GLAPIENTRY* gpuUniformMatrix3fv)(GLint location, GLint count, GLboolean transpose, const GLfloat * value);
-void (GLAPIENTRY* gpuUniformMatrix4fv)(GLint location, GLint count, GLboolean transpose, const GLfloat * value);
+GPUFUNC GLint (GLAPIENTRY* gpuGetAttribLocation)(GLuint program, const GLchar *name);
+GPUFUNC GLint (GLAPIENTRY* gpuGetUniformLocation)(GLuint program, const GLchar * name);
-GLint (GLAPIENTRY* gpuGetAttribLocation)(GLuint program, const GLchar *name);
-GLint (GLAPIENTRY* gpuGetUniformLocation)(GLuint program, const GLchar * name);
+GPUFUNC void (GLAPIENTRY* gpuUseProgram)(GLuint program);
+GPUFUNC void (GLAPIENTRY* gpuDeleteShader)(GLuint shader);
+GPUFUNC void (GLAPIENTRY* gpuDeleteProgram)(GLuint program);
-void (GLAPIENTRY* gpuUseProgram)(GLuint program);
-void (GLAPIENTRY* gpuDeleteShader)(GLuint shader);
-void (GLAPIENTRY* gpuDeleteProgram)(GLuint program);
+GPUFUNC void (GLAPIENTRY* gpuGenFramebuffers)(GLint m, GLuint * ids);
+GPUFUNC void (GLAPIENTRY* gpuBindFramebuffer)(GLuint target, GLuint framebuffer);
+GPUFUNC void (GLAPIENTRY* gpuDeleteFramebuffers)(GLint n, const GLuint * framebuffers);
-void (GLAPIENTRY* gpuGenFramebuffers)(GLint m, GLuint * ids);
-void (GLAPIENTRY* gpuBindFramebuffer)(GLuint target, GLuint framebuffer);
-void (GLAPIENTRY* gpuDeleteFramebuffers)(GLint n, const GLuint * framebuffers);
-
void GPU_func_comp_init(void);
-
#ifdef __cplusplus
}
#endif
Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_functions.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_functions.c 2012-07-03 15:14:14 UTC (rev 48545)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_functions.c 2012-07-03 15:27:27 UTC (rev 48546)
@@ -30,6 +30,7 @@
#include <GLES2/gl2.h>
#endif
+#define GPU_FUNC_INTERN
#include "GPU_functions.h"
#include REAL_GL_MODE
More information about the Bf-blender-cvs
mailing list