[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49957] branches/soc-2012-swiss_cheese/ source/blender: Adding gpuGetClearColor to get current clear color.

Alexander Kuznetsov kuzsasha at gmail.com
Fri Aug 17 19:02:24 CEST 2012


Revision: 49957
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49957
Author:   alexk
Date:     2012-08-17 17:02:24 +0000 (Fri, 17 Aug 2012)
Log Message:
-----------
Adding gpuGetClearColor to get current clear color. 

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_icons.c
    branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_widgets.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view.h
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view_gl.h

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_icons.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_icons.c	2012-08-17 16:51:54 UTC (rev 49956)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_icons.c	2012-08-17 17:02:24 UTC (rev 49957)
@@ -528,7 +528,7 @@
 
 #undef INIT_BRUSH_ICON
 }
-
+#include REAL_GL_MODE
 static void init_internal_icons(void)
 {
 	bTheme *btheme = UI_GetTheme();
@@ -615,6 +615,8 @@
 
 	IMB_freeImBuf(bbuf);
 }
+#include FAKE_GL_MODE
+
 #endif // WITH_HEADLESS
 
 static void init_iconfile_list(struct ListBase *list)
@@ -948,7 +950,7 @@
 	x2 = (ix + ih) * icongltex.invw;
 	y1 = iy * icongltex.invh;
 	y2 = (iy + ih) * icongltex.invh;
-
+#include REAL_GL_MODE
 	glEnable(GL_TEXTURE_2D);
 	glBindTexture(GL_TEXTURE_2D, icongltex.id);
 
@@ -971,6 +973,7 @@
 	gpuImmediateUnformat();
 
 	glBindTexture(GL_TEXTURE_2D, 0);
+#include FAKE_GL_MODE
 	glDisable(GL_TEXTURE_2D);
 }
 

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_widgets.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_widgets.c	2012-08-17 16:51:54 UTC (rev 49956)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_widgets.c	2012-08-17 17:02:24 UTC (rev 49957)
@@ -2859,7 +2859,7 @@
 	glEnable(GL_BLEND);
 	
 	/* can't use theme TH_BACK or TH_PANEL... undefined */
-	glGetFloatv(GL_COLOR_CLEAR_VALUE, col);
+	gpuGetClearColor(col);
 	gpuCurrentColor4f(col[0], col[1], col[2], 0.5f);
 
 	/* need -1 and +1 to make it work right for aligned buttons,

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view.c	2012-08-17 16:51:54 UTC (rev 49956)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view.c	2012-08-17 17:02:24 UTC (rev 49957)
@@ -38,6 +38,7 @@
 
 gpuColorAndClearvf = gpuColorAndClearvf_gl;
 gpuSetClearColorvf = gpuSetClearColorvf_gl;
+gpuGetClearColor = gpuGetClearColor_gl;
 
 
 gpuViewport = gpuViewport_gl;

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view.h	2012-08-17 16:51:54 UTC (rev 49956)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view.h	2012-08-17 17:02:24 UTC (rev 49957)
@@ -46,6 +46,7 @@
 
 GPU_VIEW_FUNC void (* gpuColorAndClearvf)(float c[3], float a);
 GPU_VIEW_FUNC void (* gpuSetClearColorvf)(float c[3], float a);
+GPU_VIEW_FUNC void (* gpuGetClearColor)(float r[4]);
 
 GPU_VIEW_FUNC void (* gpuClear)(int mask);
 

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view_gl.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view_gl.h	2012-08-17 16:51:54 UTC (rev 49956)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_view_gl.h	2012-08-17 17:02:24 UTC (rev 49957)
@@ -34,6 +34,8 @@
 
 void gpuSetClearColorvf_gl(float c[3], float a);
 
+void gpuGetClearColor_gl(float r[4]);
+
 void gpuViewport_gl(int x, int y, unsigned int width, unsigned int height);
 
 void gpuScissor_gl(int x, int y, unsigned int width, unsigned int height);




More information about the Bf-blender-cvs mailing list