[Bf-blender-cvs] [99384b7] temp-python-bgl: Remove command line arg to deprecated BGL

Campbell Barton noreply at git.blender.org
Fri Jul 24 02:15:44 CEST 2015


Commit: 99384b7037ece6e2bdebf494206b195aee884e62
Author: Campbell Barton
Date:   Fri Jul 24 10:03:59 2015 +1000
Branches: temp-python-bgl
https://developer.blender.org/rB99384b7037ece6e2bdebf494206b195aee884e62

Remove command line arg to deprecated BGL

Rather we do this in some more generic way, instead of each api having its own arguments.
We may also want to deprecate specific OpenGL versions in future.

Also put all method declarations & constants in code-blocks
to avoid noisy diff's when we deprecate OpenGL versions in future.

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

M	source/blender/python/BPY_extern.h
M	source/blender/python/generic/bgl.c
M	source/creator/creator.c

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

diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index 505af22..815beeb 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -97,10 +97,6 @@ void	BPY_context_update(struct bContext *C);
 
 void	BPY_id_release(struct ID *id);
 
-
-/* BGL */
-void	BGL_disable_deprecated(void);
-
 /* I18n for addons */
 #ifdef WITH_INTERNATIONAL
 const char *BPY_app_translations_py_pgettext(const char *msgctxt, const char *msgid);
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c
index 5fdc813..f72a6b1 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -38,7 +38,6 @@
 #include "MEM_guardedalloc.h"
 
 #include "bgl.h"
-#include "../BPY_extern.h"
 
 
 /* -------------------------------------------------------------------- */
@@ -1683,12 +1682,8 @@ static void method_add_impl(PyObject *submodule, PyObject *dict, PyMethodDef *me
 	}
 }
 
-bool BGL_add_deprecated = true;
-
-void BGL_disable_deprecated(void)
-{
-	BGL_add_deprecated = false;
-}
+/* TODO, expose to users */
+static bool use_deprecated = true;
 
 PyObject *BPyInit_bgl(void)
 {
@@ -1713,57 +1708,58 @@ PyObject *BPyInit_bgl(void)
 	} ((void)0)
 
 	/* GL_VERSION_1_0 */
-	MethodAdd(BlendFunc);
-	MethodAdd(Clear);
-	MethodAdd(ClearColor);
-	MethodAdd(ClearDepth);
-	MethodAdd(ClearStencil);
-	MethodAdd(ColorMask);
-	MethodAdd(CullFace);
-	MethodAdd(DepthFunc);
-	MethodAdd(DepthMask);
-	MethodAdd(DepthRange);
-	MethodAdd(Disable);
-	MethodAdd(DrawBuffer);
-	MethodAdd(Enable);
-	MethodAdd(Finish);
-	MethodAdd(Flush);
-	MethodAdd(FrontFace);
-	MethodAdd(GetBooleanv);
-	MethodAdd(GetDoublev);
-	MethodAdd(GetError);
-	MethodAdd(GetFloatv);
-	MethodAdd(GetIntegerv);
-	MethodAdd(GetString);
-	MethodAdd(GetTexImage);
-	MethodAdd(GetTexLevelParameterfv);
-	MethodAdd(GetTexLevelParameteriv);
-	MethodAdd(GetTexParameterfv);
-	MethodAdd(GetTexParameteriv);
-	MethodAdd(Hint);
-	MethodAdd(IsEnabled);
-	MethodAdd(LineWidth);
-	MethodAdd(LogicOp);
-	MethodAdd(PixelStoref);
-	MethodAdd(PixelStorei);
-	MethodAdd(PointSize);
-	MethodAdd(PolygonMode);
-	MethodAdd(ReadBuffer);
-	MethodAdd(ReadPixels);
-	MethodAdd(Scissor);
-	MethodAdd(StencilFunc);
-	MethodAdd(StencilMask);
-	MethodAdd(StencilOp);
-	MethodAdd(TexImage1D);
-	MethodAdd(TexImage2D);
-	MethodAdd(TexParameterf);
-	MethodAdd(TexParameterfv);
-	MethodAdd(TexParameteri);
-	MethodAdd(TexParameteriv);
-	MethodAdd(Viewport);
-
+	{
+		MethodAdd(BlendFunc);
+		MethodAdd(Clear);
+		MethodAdd(ClearColor);
+		MethodAdd(ClearDepth);
+		MethodAdd(ClearStencil);
+		MethodAdd(ColorMask);
+		MethodAdd(CullFace);
+		MethodAdd(DepthFunc);
+		MethodAdd(DepthMask);
+		MethodAdd(DepthRange);
+		MethodAdd(Disable);
+		MethodAdd(DrawBuffer);
+		MethodAdd(Enable);
+		MethodAdd(Finish);
+		MethodAdd(Flush);
+		MethodAdd(FrontFace);
+		MethodAdd(GetBooleanv);
+		MethodAdd(GetDoublev);
+		MethodAdd(GetError);
+		MethodAdd(GetFloatv);
+		MethodAdd(GetIntegerv);
+		MethodAdd(GetString);
+		MethodAdd(GetTexImage);
+		MethodAdd(GetTexLevelParameterfv);
+		MethodAdd(GetTexLevelParameteriv);
+		MethodAdd(GetTexParameterfv);
+		MethodAdd(GetTexParameteriv);
+		MethodAdd(Hint);
+		MethodAdd(IsEnabled);
+		MethodAdd(LineWidth);
+		MethodAdd(LogicOp);
+		MethodAdd(PixelStoref);
+		MethodAdd(PixelStorei);
+		MethodAdd(PointSize);
+		MethodAdd(PolygonMode);
+		MethodAdd(ReadBuffer);
+		MethodAdd(ReadPixels);
+		MethodAdd(Scissor);
+		MethodAdd(StencilFunc);
+		MethodAdd(StencilMask);
+		MethodAdd(StencilOp);
+		MethodAdd(TexImage1D);
+		MethodAdd(TexImage2D);
+		MethodAdd(TexParameterf);
+		MethodAdd(TexParameterfv);
+		MethodAdd(TexParameteri);
+		MethodAdd(TexParameteriv);
+		MethodAdd(Viewport);
+	}
 	/* adding in GL_VERSION_1_0 removed from core profile */
-	if (BGL_add_deprecated == true) {
+	if (use_deprecated == true) {
 		MethodAdd(Accum);
 		MethodAdd(AlphaFunc);
 		MethodAdd(Begin);
@@ -2026,22 +2022,23 @@ PyObject *BPyInit_bgl(void)
 
 
 	/* GL_VERSION_1_1 */
-	MethodAdd(BindTexture);
-	MethodAdd(CopyTexImage1D);
-	MethodAdd(CopyTexImage2D);
-	MethodAdd(CopyTexSubImage1D);
-	MethodAdd(CopyTexSubImage2D);
-	MethodAdd(DeleteTextures);
-	MethodAdd(DrawArrays);
-	MethodAdd(DrawElements);
-	MethodAdd(GenTextures);
-	MethodAdd(IsTexture);
-	MethodAdd(PolygonOffset);
-	MethodAdd(TexSubImage1D);
-	MethodAdd(TexSubImage2D);
-
+	{
+		MethodAdd(BindTexture);
+		MethodAdd(CopyTexImage1D);
+		MethodAdd(CopyTexImage2D);
+		MethodAdd(CopyTexSubImage1D);
+		MethodAdd(CopyTexSubImage2D);
+		MethodAdd(DeleteTextures);
+		MethodAdd(DrawArrays);
+		MethodAdd(DrawElements);
+		MethodAdd(GenTextures);
+		MethodAdd(IsTexture);
+		MethodAdd(PolygonOffset);
+		MethodAdd(TexSubImage1D);
+		MethodAdd(TexSubImage2D);
+	}
 	/* adding in GL_VERSION_1_1 removed from core profile */
-	if (BGL_add_deprecated == true) {
+	if (use_deprecated == true) {
 		MethodAdd(AreTexturesResident);
 		MethodAdd(ArrayElement);
 		MethodAdd(ColorPointer);
@@ -2063,25 +2060,28 @@ PyObject *BPyInit_bgl(void)
 
 
 	/* GL_VERSION_1_2 */
-	MethodAdd(CopyTexSubImage3D);
-	MethodAdd(DrawRangeElements);
-	MethodAdd(TexImage3D);
-	MethodAdd(TexSubImage3D);
+	{
+		MethodAdd(CopyTexSubImage3D);
+		MethodAdd(DrawRangeElements);
+		MethodAdd(TexImage3D);
+		MethodAdd(TexSubImage3D);
+	}
 
 
 	/* GL_VERSION_1_3 */
-	MethodAdd(ActiveTexture);
-	MethodAdd(CompressedTexImage1D);
-	MethodAdd(CompressedTexImage2D);
-	MethodAdd(CompressedTexImage3D);
-	MethodAdd(CompressedTexSubImage1D);
-	MethodAdd(CompressedTexSubImage2D);
-	MethodAdd(CompressedTexSubImage3D);
-	MethodAdd(GetCompressedTexImage);
-	MethodAdd(SampleCoverage);
-
+	{
+		MethodAdd(ActiveTexture);
+		MethodAdd(CompressedTexImage1D);
+		MethodAdd(CompressedTexImage2D);
+		MethodAdd(CompressedTexImage3D);
+		MethodAdd(CompressedTexSubImage1D);
+		MethodAdd(CompressedTexSubImage2D);
+		MethodAdd(CompressedTexSubImage3D);
+		MethodAdd(GetCompressedTexImage);
+		MethodAdd(SampleCoverage);
+	}
 	/* adding in GL_VERSION_1_3 removed from core profile */
-	if (BGL_add_deprecated == true) {
+	if (use_deprecated == true) {
 		MethodAdd(ClientActiveTexture);
 		MethodAdd(LoadTransposeMatrixd);
 		MethodAdd(LoadTransposeMatrixf);
@@ -2123,406 +2123,423 @@ PyObject *BPyInit_bgl(void)
 
 
 	/* GL_VERSION_1_4 */
-	MethodAdd(BlendColor);
-	MethodAdd(BlendEquation);
+	{
+		MethodAdd(BlendColor);
+		MethodAdd(BlendEquation);
+	}
 
 
 	/* GL_VERSION_1_5 */
-	MethodAdd(BeginQuery);
-	MethodAdd(BindBuffer);
-	MethodAdd(BufferData);
-	MethodAdd(BufferSubData);
-	MethodAdd(DeleteBuffers);
-	MethodAdd(DeleteQueries);
-	MethodAdd(EndQuery);
-	MethodAdd(GenBuffers);
-	MethodAdd(GenQueries);
-	MethodAdd(GetBufferParameteriv);
-	MethodAdd(GetBufferPointerv);
-	MethodAdd(GetBufferSubData);
-	MethodAdd(GetQueryObjectiv);
-	MethodAdd(GetQueryObjectuiv);
-	MethodAdd(GetQueryiv);
-	MethodAdd(IsBuffer);
-	MethodAdd(IsQuery);
-	MethodAdd(MapBuffer);
-	MethodAdd(UnmapBuffer);
+	{
+		MethodAdd(BeginQuery);
+		MethodAdd(BindBuffer);
+		MethodAdd(BufferData);
+		MethodAdd(BufferSubData);
+		MethodAdd(DeleteBuffers);
+		MethodAdd(DeleteQueries);
+		MethodAdd(EndQuery);
+		MethodAdd(GenBuffers);
+		MethodAdd(GenQueries);
+		MethodAdd(GetBufferParameteriv);
+		MethodAdd(GetBufferPointerv);
+		MethodAdd(GetBufferSubData);
+		MethodAdd(GetQueryObjectiv);
+		MethodAdd(GetQueryObjectuiv);
+		MethodAdd(GetQueryiv);
+		MethodAdd(IsBuffer);
+		MethodAdd(IsQuery);
+		MethodAdd(MapBuffer);
+		MethodAdd(UnmapBuffer);
+	}
 
 
 	/* GL_VERSION_2_0 */
-	MethodAdd(AttachShader);
-	MethodAdd(BindAttribLocation);
-	MethodAdd(BlendEquationSeparate);
-	MethodAdd(CompileShader);
-	MethodAdd(CreateProgram);
-	MethodAdd(CreateShader);
-	MethodAdd(DeleteProgram);
-	MethodAdd(DeleteShader);
-	MethodAdd(DetachShader);
-	MethodAdd(DisableVertexAttribArray);
-	MethodAdd(DrawBuffers);
-	MethodAdd(EnableVertexAttribArray);
-	MethodAdd(GetActiveAttrib);
-	MethodAdd(GetActiveUniform);
-	MethodAdd(GetAttachedShaders);
-	MethodAdd(GetAttribLocation);
-	MethodAdd(GetProgramInfoLog);
-	MethodAdd(GetProgramiv);
-	MethodAdd(GetShaderInfoLog);
-	MethodAdd(GetShaderSource);
-	MethodAdd(GetShaderiv);
-	MethodAdd(GetUniformLocation);
-	MethodAdd(GetUniformfv);
-	MethodAdd(GetUniformiv);
-	MethodAdd(GetVertexAttribPointerv);
-	MethodAdd(GetVertexAttribdv);
-	MethodAdd(GetVertexAttribfv);
-	MethodAdd(GetVertexAttribiv);
-	MethodAdd(IsProgram);
-	MethodAdd(IsShader);
-	MethodAdd(LinkProgram);
-	MethodAdd(ShaderSource);
-	MethodAdd(StencilFuncSeparate);
-	MethodAdd(StencilMaskSeparate);
-	MethodAdd(StencilOpSeparate);
-	MethodAdd(Uniform1f);
-	MethodAdd(Uniform1fv);
-	MethodAdd(Uniform1i);
-	MethodAdd(Uniform1iv);
-	MethodAdd(Uniform2f);
-	MethodAdd(Uniform2fv);
-	MethodAdd(Uniform2i);
-	MethodAdd(Uniform2iv);
-	MethodAdd(Uniform3f);
-	MethodAdd(Uniform3fv);
-	MethodAdd(Uniform3i);
-	MethodAdd(Uniform3iv);
-	MethodAdd(Uniform4f);
-	MethodAdd(Uniform4fv);
-	MethodAdd(Uniform4i);
-	MethodAdd(Uniform4iv);
-	MethodAdd(UniformMatrix2fv);
-	MethodAdd(UniformMatrix3fv);
-	MethodAdd(UniformMatrix4fv);
-	MethodAdd(UseProgram);
-	MethodAdd(ValidateProgram);
-	MethodAdd(VertexAttrib1d);
-	MethodAdd(VertexAttrib1dv);
-	MethodAdd(VertexAttrib1f);
-	MethodAdd(VertexAttrib1fv);
-	MethodAdd(VertexAttrib1s);
-	MethodAdd(VertexAttrib1sv);
-	MethodAdd(VertexAttrib2d);
-	MethodAdd(VertexAttrib2dv);
-	MethodAdd(VertexAttrib2f);
-	MethodAdd(VertexAttrib2fv);
-	MethodAdd(VertexAttrib2s);
-	MethodAdd(VertexAttrib2sv);
-	MethodAdd(VertexAttrib3d);
-	MethodAdd(VertexAttrib3dv);
-	MethodAdd(VertexAttrib3f);
-	MethodAdd(VertexAttrib3fv);
-	MethodAdd(VertexAttrib3s);
-	MethodAdd(VertexAttrib3sv);
-	MethodAdd(VertexAttrib4Nbv);
-	MethodAdd(VertexAttrib4Niv);
-	MethodAdd(VertexAttrib4Nsv);
-	MethodAdd(VertexAttrib4Nub);
-	MethodAdd(VertexAttrib4Nubv);
-	MethodAdd(VertexAttrib4Nuiv);
-	MethodAdd(VertexAttrib4Nusv);
-	MethodAdd(VertexAttrib4bv);
-	MethodAdd(VertexAttrib4d);
-	MethodAdd(VertexAttrib4dv);
-	MethodAdd(VertexAttrib4f);
-	MethodAdd(VertexAttrib4fv);
-	MethodAdd(VertexAttrib4iv);
-	MethodAdd(VertexAttrib4s);
-	MethodAdd(VertexAttrib4sv);
-	MethodAdd(VertexAttrib4ubv);
-	MethodAdd(VertexAttrib4uiv);
-	MethodAdd(VertexAttrib4usv);
-	MethodAdd(VertexAttribPointe

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list