diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-19 13:18:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-19 13:18:04 +0300 |
commit | b4d053efc75424fca4b413ac1bc7a7e826fac629 (patch) | |
tree | 80647d9ca9109e997fce9911f202f98d7f8577d4 /source/blender/windowmanager | |
parent | 349946bd010b1112b13c8594aabfb318c330bc0d (diff) |
Gawain API naming refactor
Use consistent prefix for gawain API names as well as
some abbreviations to avoid over-long names, see: D2678
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 18 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 16 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_stereo.c | 24 |
5 files changed, 35 insertions, 35 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 5be3429f2de..7aaed4086ed 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -441,9 +441,9 @@ void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple, float alpha) halfy /= triple->y; #endif - VertexFormat *format = immVertexFormat(); - unsigned int texcoord = VertexFormat_add_attrib(format, "texCoord", COMP_F32, 2, KEEP_FLOAT); - unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); const int activeTex = 7; /* arbitrary */ glActiveTexture(GL_TEXTURE0 + activeTex); @@ -460,7 +460,7 @@ void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple, float alpha) immUniform1f("alpha", alpha); immUniform1i("image", activeTex); - immBegin(PRIM_TRIANGLE_FAN, 4); + immBegin(GWN_PRIM_TRI_FAN, 4); immAttrib2f(texcoord, halfx, halfy); immVertex2f(pos, 0.0f, 0.0f); diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 92215757d88..1ffe96181f0 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -172,7 +172,7 @@ static void wm_gesture_draw_line(wmGesture *gt) { rcti *rect = (rcti *)gt->customdata; - uint shdr_pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); + uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_COLOR); @@ -187,7 +187,7 @@ static void wm_gesture_draw_line(wmGesture *gt) float xmin = (float)rect->xmin; float ymin = (float)rect->ymin; - immBegin(PRIM_LINES, 2); + immBegin(GWN_PRIM_LINES, 2); immVertex2f(shdr_pos, xmin, ymin); immVertex2f(shdr_pos, (float)rect->xmax, (float)rect->ymax); immEnd(); @@ -199,7 +199,7 @@ static void wm_gesture_draw_rect(wmGesture *gt) { rcti *rect = (rcti *)gt->customdata; - uint shdr_pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_I32, 2, CONVERT_INT_TO_FLOAT); + uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); glEnable(GL_BLEND); @@ -212,7 +212,7 @@ static void wm_gesture_draw_rect(wmGesture *gt) glDisable(GL_BLEND); - shdr_pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); + shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_COLOR); @@ -237,7 +237,7 @@ static void wm_gesture_draw_circle(wmGesture *gt) glEnable(GL_BLEND); - const uint shdr_pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); + const uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -353,7 +353,7 @@ static void wm_gesture_draw_lasso(wmWindow *win, wmGesture *gt, bool filled) return; } - const uint shdr_pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); + const uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_COLOR); @@ -365,7 +365,7 @@ static void wm_gesture_draw_lasso(wmWindow *win, wmGesture *gt, bool filled) immUniformArray4fv("colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2); immUniform1f("dash_width", 2.0f); - immBegin((gt->type == WM_GESTURE_LASSO) ? PRIM_LINE_LOOP : PRIM_LINE_STRIP, numverts); + immBegin((gt->type == WM_GESTURE_LASSO) ? GWN_PRIM_LINE_LOOP : GWN_PRIM_LINE_STRIP, numverts); for (i = 0; i < gt->points; i++, lasso += 2) { immVertex2f(shdr_pos, (float)lasso[0], (float)lasso[1]); @@ -384,7 +384,7 @@ static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt) float x1, x2, y1, y2; - const uint shdr_pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); + const uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_COLOR); @@ -396,7 +396,7 @@ static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt) immUniformArray4fv("colors", (float *)(float[][4]){{0.4f, 0.4f, 0.4f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2); immUniform1f("dash_width", 8.0f); - immBegin(PRIM_LINES, 4); + immBegin(GWN_PRIM_LINES, 4); x1 = (float)(rect->xmin - winsize_x); y1 = (float)rect->ymin; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index f925f22e878..5001fc7817f 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3071,12 +3071,12 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph RNA_property_float_get_array(fill_ptr, fill_prop, col); } - VertexFormat *format = immVertexFormat(); - unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); if (rc->gltex) { - unsigned int texCoord = VertexFormat_add_attrib(format, "texCoord", COMP_F32, 2, KEEP_FLOAT); + unsigned int texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); glBindTexture(GL_TEXTURE_2D, rc->gltex); @@ -3099,7 +3099,7 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph } /* draw textured quad */ - immBegin(PRIM_TRIANGLE_FAN, 4); + immBegin(GWN_PRIM_TRI_FAN, 4); immAttrib2f(texCoord, 0, 0); immVertex2f(pos, -radius, -radius); @@ -3203,8 +3203,8 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd if (rc->col_prop) RNA_property_float_get_array(&rc->col_ptr, rc->col_prop, col); - VertexFormat *format = immVertexFormat(); - unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3fvAlpha(col, 0.5f); @@ -3214,14 +3214,14 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd /* draw original angle line */ gpuRotate2D(RAD2DEGF(rc->initial_value)); - immBegin(PRIM_LINES, 2); + immBegin(GWN_PRIM_LINES, 2); immVertex2f(pos, (float)WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE, 0.0f); immVertex2f(pos, (float)WM_RADIAL_CONTROL_DISPLAY_SIZE, 0.0f); immEnd(); /* draw new angle line */ gpuRotate2D(RAD2DEGF(rc->current_value - rc->initial_value)); - immBegin(PRIM_LINES, 2); + immBegin(GWN_PRIM_LINES, 2); immVertex2f(pos, (float)WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE, 0.0f); immVertex2f(pos, (float)WM_RADIAL_CONTROL_DISPLAY_SIZE, 0.0f); immEnd(); diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 434c6414c01..445516ffda7 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -364,12 +364,12 @@ static void playanim_toscreen(PlayState *ps, PlayAnimPict *picture, struct ImBuf gpuPushMatrix(); gpuLoadIdentity(); - unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); + unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ub(0, 255, 0); - immBegin(PRIM_LINES, 2); + immBegin(GWN_PRIM_LINES, 2); immVertex2f(pos, fac, -1.0f); immVertex2f(pos, fac, 1.0f); immEnd(); diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c index f8c4639c1b1..1e63a0e4483 100644 --- a/source/blender/windowmanager/intern/wm_stereo.c +++ b/source/blender/windowmanager/intern/wm_stereo.c @@ -115,9 +115,9 @@ static void wm_method_draw_stereo3d_interlace(wmWindow *win) float halfx = GLA_PIXEL_OFS; float halfy = GLA_PIXEL_OFS; - VertexFormat *format = immVertexFormat(); - unsigned int texcoord = VertexFormat_add_attrib(format, "texCoord", COMP_F32, 2, KEEP_FLOAT); - unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_INTERLACE); @@ -132,7 +132,7 @@ static void wm_method_draw_stereo3d_interlace(wmWindow *win) immUniform1i("interlace_id", interlace_gpu_id_from_type(interlace_type)); - immBegin(PRIM_TRIANGLE_FAN, 4); + immBegin(GWN_PRIM_TRI_FAN, 4); immAttrib2f(texcoord, halfx, halfy); immVertex2f(pos, 0.0f, 0.0f); @@ -199,9 +199,9 @@ static void wm_method_draw_stereo3d_sidebyside(wmWindow *win) int soffx; bool cross_eyed = (win->stereo3d_format->flag & S3D_SIDEBYSIDE_CROSSEYED) != 0; - VertexFormat *format = immVertexFormat(); - unsigned int texcoord = VertexFormat_add_attrib(format, "texCoord", COMP_F32, 2, KEEP_FLOAT); - unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); for (view = 0; view < 2; view ++) { drawdata = BLI_findlink(&win->drawdata, (view * 2) + 1); @@ -242,7 +242,7 @@ static void wm_method_draw_stereo3d_sidebyside(wmWindow *win) immUniform1f("alpha", 1.0f); immUniform1i("image", 0); /* default GL_TEXTURE0 unit */ - immBegin(PRIM_TRIANGLE_FAN, 4); + immBegin(GWN_PRIM_TRI_FAN, 4); immAttrib2f(texcoord, halfx, halfy); immVertex2f(pos, soffx, 0.0f); @@ -272,9 +272,9 @@ static void wm_method_draw_stereo3d_topbottom(wmWindow *win) int view; int soffy; - VertexFormat *format = immVertexFormat(); - unsigned int texcoord = VertexFormat_add_attrib(format, "texCoord", COMP_F32, 2, KEEP_FLOAT); - unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); + Gwn_VertFormat *format = immVertexFormat(); + unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); for (view = 0; view < 2; view ++) { drawdata = BLI_findlink(&win->drawdata, (view * 2) + 1); @@ -312,7 +312,7 @@ static void wm_method_draw_stereo3d_topbottom(wmWindow *win) immUniform1f("alpha", 1.0f); immUniform1i("image", 0); /* default GL_TEXTURE0 unit */ - immBegin(PRIM_TRIANGLE_FAN, 4); + immBegin(GWN_PRIM_TRI_FAN, 4); immAttrib2f(texcoord, halfx, halfy); immVertex2f(pos, 0.0f, soffy); |