Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-07-15 16:27:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-15 16:34:13 +0300
commit57ab7daa2aee436b0b0acfa00b2e2b1d28b55b2c (patch)
tree377218e81452e4e0d3f8ca3cf3c3ac5148f237b8 /source/blender/editors/space_view3d
parentb457cae397054a1be4e60f3007995f97c198b2b6 (diff)
GPU_matrix: use Blender's naming conventions
Thanks to @sergey for review
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c4
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c16
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c14
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c26
-rw-r--r--source/blender/editors/space_view3d/view3d_project.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_utils.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c6
9 files changed, 40 insertions, 40 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index beb323fb21c..f48d7ef578f 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -621,7 +621,7 @@ void draw_object_backbufsel(
select_mode = ts->selectmode;
}
- gpuMultMatrix(ob->obmat);
+ GPU_matrix_mul(ob->obmat);
glClearDepth(1.0); GPU_clear(GPU_DEPTH_BIT);
GPU_depth_test(true);
@@ -688,7 +688,7 @@ void draw_object_backbufsel(
break;
}
- gpuLoadMatrix(rv3d->viewmat);
+ GPU_matrix_set(rv3d->viewmat);
}
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index dca4b3f4f76..75c9b4a050f 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -251,7 +251,7 @@ void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d)
/* we have to multiply instead of loading viewmatob to make
* it work with duplis using displists, otherwise it will
* override the dupli-matrix */
- gpuMultMatrix(ob->obmat);
+ GPU_matrix_mul(ob->obmat);
}
#ifdef DEBUG
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 89d01727d9b..4928f6e1f28 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -184,8 +184,8 @@ static void view3d_main_region_setup_view(
ED_view3d_update_viewmat(depsgraph, scene, v3d, ar, viewmat, winmat, rect);
/* set for opengl */
- gpuLoadProjectionMatrix(rv3d->winmat);
- gpuLoadMatrix(rv3d->viewmat);
+ GPU_matrix_projection_set(rv3d->winmat);
+ GPU_matrix_set(rv3d->viewmat);
}
static bool view3d_stereo3d_active(wmWindow *win, Scene *scene, View3D *v3d, RegionView3D *rv3d)
@@ -1355,10 +1355,10 @@ void ED_view3d_draw_offscreen(
GPU_free_images_anim(G.main); /* XXX :((( */
}
- gpuPushProjectionMatrix();
- gpuLoadIdentity();
- gpuPushMatrix();
- gpuLoadIdentity();
+ GPU_matrix_push_projection();
+ GPU_matrix_identity_set();
+ GPU_matrix_push();
+ GPU_matrix_identity_set();
if ((viewname != NULL && viewname[0] != '\0') && (viewmat == NULL) && rv3d->persp == RV3D_CAMOB && v3d->camera)
view3d_stereo3d_setup_offscreen(depsgraph, scene, v3d, ar, winmat, viewname);
@@ -1375,8 +1375,8 @@ void ED_view3d_draw_offscreen(
ar->winy = bwiny;
ar->winrct = brect;
- gpuPopProjectionMatrix();
- gpuPopMatrix();
+ GPU_matrix_pop_projection();
+ GPU_matrix_pop();
UI_Theme_Restore(&theme_state);
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index cfeb199de15..cc7f23e2c18 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -685,13 +685,13 @@ static void view3d_draw_bgpic(Scene *scene, Depsgraph *depsgraph,
GPU_blend(true);
GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
- gpuPushProjectionMatrix();
- gpuPushMatrix();
+ GPU_matrix_push_projection();
+ GPU_matrix_push();
ED_region_pixelspace(ar);
- gpuTranslate2f(centx, centy);
- gpuScaleUniform(bgpic->scale);
- gpuRotate2D(RAD2DEGF(-bgpic->rotation));
+ GPU_matrix_translate_2f(centx, centy);
+ GPU_matrix_scale_1f(bgpic->scale);
+ GPU_matrix_rotate_2d(RAD2DEGF(-bgpic->rotation));
if (bgpic->flag & CAM_BGIMG_FLAG_FLIP_X) {
zoomx *= -1.0f;
@@ -707,8 +707,8 @@ static void view3d_draw_bgpic(Scene *scene, Depsgraph *depsgraph,
immDrawPixelsTex(&state, x1 - centx, y1 - centy, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_LINEAR, ibuf->rect,
zoomx, zoomy, col);
- gpuPopProjectionMatrix();
- gpuPopMatrix();
+ GPU_matrix_pop_projection();
+ GPU_matrix_pop();
GPU_blend(false);
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index f296c2ee874..6040e21aacb 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -195,8 +195,8 @@ static void axis_geom_draw(const wmGizmo *gz, const float color[4], const bool U
static const float axis_highlight[4] = {1, 1, 1, 1};
static const float axis_black[4] = {0, 0, 0, 1};
static float axis_color[3][4];
- gpuPushMatrix();
- gpuMultMatrix(gz->matrix_offset);
+ GPU_matrix_push();
+ GPU_matrix_mul(gz->matrix_offset);
bool draw_center_done = false;
@@ -219,11 +219,11 @@ static void axis_geom_draw(const wmGizmo *gz, const float color[4], const bool U
/* Circle defining active area (revert back to 2D space). */
{
- gpuPopMatrix();
+ GPU_matrix_pop();
immUniformColor4fv(color);
imm_draw_circle_fill_3d(pos_id, 0, 0, 1.0f, DIAL_RESOLUTION);
- gpuPushMatrix();
- gpuMultMatrix(gz->matrix_offset);
+ GPU_matrix_push();
+ GPU_matrix_mul(gz->matrix_offset);
}
draw_center_done = true;
}
@@ -276,15 +276,15 @@ static void axis_geom_draw(const wmGizmo *gz, const float color[4], const bool U
/* Axis Ball. */
{
- gpuPushMatrix();
- gpuTranslate3fv(v_final);
- gpuScaleUniform(is_pos ? 0.22f : 0.18f);
+ GPU_matrix_push();
+ GPU_matrix_translate_3fv(v_final);
+ GPU_matrix_scale_1f(is_pos ? 0.22f : 0.18f);
Gwn_Batch *sphere = GPU_batch_preset_sphere(0);
GWN_batch_program_set_builtin(sphere, GPU_SHADER_3D_UNIFORM_COLOR);
GWN_batch_uniform_4fv(sphere, "color", is_pos ? color_current : color_current_fade);
GWN_batch_draw(sphere);
- gpuPopMatrix();
+ GPU_matrix_pop();
}
/* Axis XYZ Character. */
@@ -298,7 +298,7 @@ static void axis_geom_draw(const wmGizmo *gz, const float color[4], const bool U
}
}
- gpuPopMatrix();
+ GPU_matrix_pop();
immUnbindProgram();
}
@@ -318,13 +318,13 @@ static void axis3d_draw_intern(
.matrix_offset = matrix_unit,
}), matrix_final);
- gpuPushMatrix();
- gpuMultMatrix(matrix_final);
+ GPU_matrix_push();
+ GPU_matrix_mul(matrix_final);
GPU_blend(true);
axis_geom_draw(gz, color, select);
GPU_blend(false);
- gpuPopMatrix();
+ GPU_matrix_pop();
}
static void gizmo_axis_draw(const bContext *C, wmGizmo *gz)
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index 30b91c1a8ee..91e255aec82 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -677,7 +677,7 @@ void ED_view3d_project(const struct ARegion *ar, const float world[3], float reg
RegionView3D *rv3d = ar->regiondata;
int viewport[4] = {0, 0, ar->winx, ar->winy};
- gpuProject(world, rv3d->viewmat, rv3d->winmat, viewport, region);
+ GPU_matrix_project(world, rv3d->viewmat, rv3d->winmat, viewport, region);
}
bool ED_view3d_unproject(const struct ARegion *ar, float regionx, float regiony, float regionz, float world[3])
@@ -686,5 +686,5 @@ bool ED_view3d_unproject(const struct ARegion *ar, float regionx, float regiony,
int viewport[4] = {0, 0, ar->winx, ar->winy};
float region[3] = {regionx, regiony, regionz};
- return gpuUnProject(region, rv3d->viewmat, rv3d->winmat, viewport, world);
+ return GPU_matrix_unproject(region, rv3d->viewmat, rv3d->winmat, viewport, world);
}
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 0f82dfa775c..3175075e9c3 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -510,7 +510,7 @@ static void do_lasso_select_mesh(
/* for non zbuf projections, don't change the GL state */
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
- gpuLoadMatrix(vc->rv3d->viewmat);
+ GPU_matrix_set(vc->rv3d->viewmat);
bbsel = EDBM_backbuf_border_mask_init(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
if (ts->selectmode & SCE_SELECT_VERTEX) {
@@ -1936,7 +1936,7 @@ static int do_mesh_box_select(
/* for non zbuf projections, don't change the GL state */
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
- gpuLoadMatrix(vc->rv3d->viewmat);
+ GPU_matrix_set(vc->rv3d->viewmat);
bbsel = EDBM_backbuf_border_init(vc, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
if (ts->selectmode & SCE_SELECT_VERTEX) {
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index ca5375b6b54..9b006bf4d9b 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -189,8 +189,8 @@ void view3d_region_operator_needs_opengl(wmWindow *UNUSED(win), ARegion *ar)
RegionView3D *rv3d = ar->regiondata;
wmViewport(&ar->winrct); // TODO: bad
- gpuLoadProjectionMatrix(rv3d->winmat);
- gpuLoadMatrix(rv3d->viewmat);
+ GPU_matrix_projection_set(rv3d->winmat);
+ GPU_matrix_set(rv3d->viewmat);
}
}
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index c9e915a6415..bb0745b1998 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -721,14 +721,14 @@ void view3d_winmatrix_set(Depsgraph *depsgraph, ARegion *ar, const View3D *v3d,
}
if (is_ortho) {
- gpuOrtho(viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
+ GPU_matrix_ortho_set(viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
}
else {
- gpuFrustum(viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
+ GPU_matrix_frustum_set(viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
}
/* update matrix in 3d view region */
- gpuGetProjectionMatrix(rv3d->winmat);
+ GPU_matrix_projection_get(rv3d->winmat);
}
static void obmat_to_viewmat(RegionView3D *rv3d, Object *ob)