diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-15 16:27:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-15 16:34:13 +0300 |
commit | 57ab7daa2aee436b0b0acfa00b2e2b1d28b55b2c (patch) | |
tree | 377218e81452e4e0d3f8ca3cf3c3ac5148f237b8 /source/blender/windowmanager | |
parent | b457cae397054a1be4e60f3007995f97c198b2b6 (diff) |
GPU_matrix: use Blender's naming conventions
Thanks to @sergey for review
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 18 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 16 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_subwindow.c | 8 |
3 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 5cf9ac625c3..64aa64e1478 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2118,8 +2118,8 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph /* set up rotation if available */ if (rc->rot_prop) { rot = RNA_property_float_get(&rc->rot_ptr, rc->rot_prop); - gpuPushMatrix(); - gpuRotate2D(RAD2DEGF(rot)); + GPU_matrix_push(); + GPU_matrix_rotate_2d(RAD2DEGF(rot)); } /* draw textured quad */ @@ -2141,7 +2141,7 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph /* undo rotation */ if (rc->rot_prop) - gpuPopMatrix(); + GPU_matrix_pop(); } else { /* flat color if no texture available */ @@ -2208,7 +2208,7 @@ static void radial_control_paint_cursor(bContext *UNUSED(C), int x, int y, void /* Keep cursor in the original place */ x = rc->initial_mouse[0]; y = rc->initial_mouse[1]; - gpuTranslate2f((float)x, (float)y); + GPU_matrix_translate_2f((float)x, (float)y); glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); @@ -2216,7 +2216,7 @@ static void radial_control_paint_cursor(bContext *UNUSED(C), int x, int y, void /* apply zoom if available */ if (rc->zoom_prop) { RNA_property_float_get_array(&rc->zoom_ptr, rc->zoom_prop, zoom); - gpuScale2fv(zoom); + GPU_matrix_scale_2fv(zoom); } /* draw rotated texture */ @@ -2233,23 +2233,23 @@ static void radial_control_paint_cursor(bContext *UNUSED(C), int x, int y, void immUniformColor3fvAlpha(col, 0.5f); if (rc->subtype == PROP_ANGLE) { - gpuPushMatrix(); + GPU_matrix_push(); /* draw original angle line */ - gpuRotate2D(RAD2DEGF(rc->initial_value)); + GPU_matrix_rotate_2d(RAD2DEGF(rc->initial_value)); 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)); + GPU_matrix_rotate_2d(RAD2DEGF(rc->current_value - rc->initial_value)); 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(); - gpuPopMatrix(); + GPU_matrix_pop(); } /* draw circles on top */ diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 003932930ed..7ddc87a2524 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -201,8 +201,8 @@ static void playanim_window_get_size(int *r_width, int *r_height) static void playanim_gl_matrix(void) { /* unified matrix, note it affects offset for drawing */ - /* note! cannot use gpuOrtho2D here because shader ignores. */ - gpuOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0, 1.0f); + /* note! cannot use GPU_matrix_ortho_2d_set here because shader ignores. */ + GPU_matrix_ortho_set(0.0f, 1.0f, 0.0f, 1.0f, -1.0, 1.0f); } /* implementation */ @@ -366,10 +366,10 @@ static void playanim_toscreen(PlayState *ps, PlayAnimPict *picture, struct ImBuf float fac = ps->picture->frame / (double)(((PlayAnimPict *)picsbase.last)->frame - ((PlayAnimPict *)picsbase.first)->frame); fac = 2.0f * fac - 1.0f; - gpuPushProjectionMatrix(); - gpuLoadIdentityProjectionMatrix(); - gpuPushMatrix(); - gpuLoadIdentity(); + GPU_matrix_push_projection(); + GPU_matrix_identity_projection_set(); + GPU_matrix_push(); + GPU_matrix_identity_set(); uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); @@ -383,8 +383,8 @@ static void playanim_toscreen(PlayState *ps, PlayAnimPict *picture, struct ImBuf immUnbindProgram(); - gpuPopMatrix(); - gpuPopProjectionMatrix(); + GPU_matrix_pop(); + GPU_matrix_pop_projection(); } GHOST_SwapWindowBuffers(g_WS.ghost_window); diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index f55eee69f71..ff3c712dae0 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -50,7 +50,7 @@ void wmViewport(const rcti *winrct) glScissor(winrct->xmin, winrct->ymin, width, height); wmOrtho2_pixelspace(width, height); - gpuLoadIdentity(); + GPU_matrix_identity_set(); } void wmPartialViewport(rcti *drawrct, const rcti *winrct, const rcti *partialrct) @@ -89,7 +89,7 @@ void wmPartialViewport(rcti *drawrct, const rcti *winrct, const rcti *partialrct glScissor(x, y, scissor_width, scissor_height); wmOrtho2_pixelspace(width, height); - gpuLoadIdentity(); + GPU_matrix_identity_set(); } void wmWindowViewport(wmWindow *win) @@ -101,7 +101,7 @@ void wmWindowViewport(wmWindow *win) glScissor(0, 0, width, height); wmOrtho2_pixelspace(width, height); - gpuLoadIdentity(); + GPU_matrix_identity_set(); } void wmOrtho2(float x1, float x2, float y1, float y2) @@ -110,7 +110,7 @@ void wmOrtho2(float x1, float x2, float y1, float y2) if (x1 == x2) x2 += 1.0f; if (y1 == y2) y2 += 1.0f; - gpuOrtho(x1, x2, y1, y2, -100, 100); + GPU_matrix_ortho_set(x1, x2, y1, y2, -100, 100); } static void wmOrtho2_offset(const float x, const float y, const float ofs) |