diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-04-07 23:31:26 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-04-07 23:31:26 +0300 |
commit | bd3a1b9490d96ca00748f405037379b743744877 (patch) | |
tree | aed8ff42fb92cc78de6729cd6d90c3c5ee9ad8ca /source/blender/editors/space_clip | |
parent | c1dc078840541bd64f95fdeca52267c75a061e04 (diff) |
OpenGL: use PRIM instead of GL enum for immBegin
Getting ready for a Gawain API change...
Part of T49043
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 48 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_draw.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_utils.c | 4 |
3 files changed, 31 insertions, 31 deletions
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 274e9b0f684..0986a4bc4a7 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -79,7 +79,7 @@ static void draw_keyframe(int frame, int cfra, int sfra, float framelen, int wid int x = (frame - sfra) * framelen; if (width == 1) { - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex2i(pos, x, 0); immVertex2i(pos, x, height * UI_DPI_FAC); immEnd(); @@ -447,7 +447,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin if ((b - a - 1) >= 1) { glPointSize(5.0f); - immBegin(GL_POINTS, b - a - 1); + immBegin(PRIM_POINTS, b - a - 1); for (i = a; i < b; i++) { if (i != curindex) { @@ -462,7 +462,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin if ((b - a) >= 2) { glLineWidth(3.0f); - immBegin(GL_LINE_STRIP, b - a); + immBegin(PRIM_LINE_STRIP, b - a); for (i = a; i < b; i++) { immVertex2f(pos, path[i][0], path[i][1]); @@ -478,7 +478,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin if ((curindex - a) >= 1) { immUniformThemeColor(TH_PATH_BEFORE); - immBegin(GL_POINTS, curindex - a); + immBegin(PRIM_POINTS, curindex - a); for (i = a; i < curindex; i++) { immVertex2f(pos, path[i][0], path[i][1]); @@ -490,7 +490,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin if ((b - curindex - 1) >= 1) { immUniformThemeColor(TH_PATH_AFTER); - immBegin(GL_POINTS, b - curindex - 1); + immBegin(PRIM_POINTS, b - curindex - 1); for (i = curindex + 1; i < b; i++) { immVertex2f(pos, path[i][0], path[i][1]); @@ -505,7 +505,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin if ((curindex - a + 1) >= 2) { immUniformThemeColor(TH_PATH_BEFORE); - immBegin(GL_LINE_STRIP, curindex - a + 1); + immBegin(PRIM_LINE_STRIP, curindex - a + 1); for (i = a; i <= curindex; i++) { immVertex2f(pos, path[i][0], path[i][1]); @@ -517,7 +517,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin if ((b - curindex) >= 2) { immUniformThemeColor(TH_PATH_AFTER); - immBegin(GL_LINE_STRIP, b - curindex); + immBegin(PRIM_LINE_STRIP, b - curindex); for (i = curindex; i < b; i++) { immVertex2f(pos, path[i][0], path[i][1]); @@ -558,12 +558,12 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT { glPointSize(tiny ? 3.0f : 4.0f); - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); immVertex2f(position, pos[0], pos[1]); immEnd(); } else { - immBegin(GL_LINES, 8); + immBegin(PRIM_LINES, 8); immVertex2f(position, pos[0] + px[0] * 2, pos[1]); immVertex2f(position, pos[0] + px[0] * 8, pos[1]); @@ -586,7 +586,7 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT gpuTranslate2fv(marker_pos); if (sc->flag & SC_SHOW_MARKER_PATTERN) { - immBegin(GL_LINE_LOOP, 4); + immBegin(PRIM_LINE_LOOP, 4); immVertex2fv(position, marker->pattern_corners[0]); immVertex2fv(position, marker->pattern_corners[1]); immVertex2fv(position, marker->pattern_corners[2]); @@ -670,12 +670,12 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra { glPointSize(tiny ? 1.0f : 2.0f); - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); immVertex2f(position, pos[0], pos[1]); immEnd(); } else { - immBegin(GL_LINES, 8); + immBegin(PRIM_LINES, 8); immVertex2f(position, pos[0] + px[0] * 3, pos[1]); immVertex2f(position, pos[0] + px[0] * 7, pos[1]); @@ -697,7 +697,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra glEnable(GL_COLOR_LOGIC_OP); glLogicOp(GL_NOR); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex2fv(position, pos); immVertex2fv(position, marker_pos); immEnd(); @@ -743,7 +743,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra } if ((track->pat_flag & SELECT) == sel && (sc->flag & SC_SHOW_MARKER_PATTERN)) { - immBegin(GL_LINE_LOOP, 4); + immBegin(PRIM_LINE_LOOP, 4); immVertex2fv(position, marker->pattern_corners[0]); immVertex2fv(position, marker->pattern_corners[1]); immVertex2fv(position, marker->pattern_corners[2]); @@ -814,7 +814,7 @@ static void draw_marker_slide_triangle(float x, float y, float dx, float dy, int tdy += px[1]; } - immBegin(GL_TRIANGLES, 3); + immBegin(PRIM_TRIANGLES, 3); immVertex2f(pos, x, y); immVertex2f(pos, x - tdx, y); immVertex2f(pos, x, y + tdy); @@ -892,7 +892,7 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo glLineWidth(outline ? 3.0f : 1.0f); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex2f(pos, 0.0f, 0.0f); immVertex2fv(pos, tilt_ctrl); immEnd(); @@ -1186,7 +1186,7 @@ static void draw_plane_marker_ex(SpaceClip *sc, Scene *scene, MovieTrackingPlane glLineWidth(thick ? 3.0f : 1.0f); /* Draw rectangle itself. */ - immBegin(GL_LINE_LOOP, 4); + immBegin(PRIM_LINE_LOOP, 4); immVertex2fv(pos, plane_marker->corners[0]); immVertex2fv(pos, plane_marker->corners[1]); immVertex2fv(pos, plane_marker->corners[2]); @@ -1199,7 +1199,7 @@ static void draw_plane_marker_ex(SpaceClip *sc, Scene *scene, MovieTrackingPlane immUniformColor3f(1.0f, 0.0f, 0.0f); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); getArrowEndPoint(width, height, sc->zoom, plane_marker->corners[0], plane_marker->corners[1], end_point); immVertex2fv(pos, plane_marker->corners[0]); @@ -1209,7 +1209,7 @@ static void draw_plane_marker_ex(SpaceClip *sc, Scene *scene, MovieTrackingPlane immUniformColor3f(0.0f, 1.0f, 0.0f); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); getArrowEndPoint(width, height, sc->zoom, plane_marker->corners[0], plane_marker->corners[3], end_point); immVertex2fv(pos, plane_marker->corners[0]); @@ -1468,7 +1468,7 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie immUniformColor3f(1.0f, 0.0f, 0.0f); } - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); if (undistort) { immVertex2f(position, pos[0] / width, pos[1] / (height * aspy)); @@ -1624,7 +1624,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, immUniformColor3f(1.0f, 0.0f, 0.0f); for (i = 0; i <= n; i++) { - immBegin(GL_LINE_STRIP, n + 1); + immBegin(PRIM_LINE_STRIP, n + 1); for (j = 0; j <= n; j++) { immVertex2fv(position, grid[i][j]); @@ -1634,7 +1634,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, } for (j = 0; j <= n; j++) { - immBegin(GL_LINE_STRIP, n + 1); + immBegin(PRIM_LINE_STRIP, n + 1); for (i = 0; i <= n; i++) { immVertex2fv(position, grid[i][j]); @@ -1692,7 +1692,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, sub_v2_v2v2(dpos, npos, pos); mul_v2_fl(dpos, 1.0f / steps); - immBegin(GL_LINE_STRIP, steps + 1); + immBegin(PRIM_LINE_STRIP, steps + 1); for (j = 0; j <= steps; j++) { BKE_tracking_distort_v2(tracking, pos, tpos); @@ -1705,7 +1705,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, } } else if (stroke->totpoints == 1) { - immBegin(GL_POINTS, 1); + immBegin(PRIM_POINTS, 1); immVertex2f(position, stroke->points[0].x + offsx, stroke->points[0].y + offsy); immEnd(); } diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 3698fba0d54..c9db5d4a328 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -90,11 +90,11 @@ static void tracking_segment_start_cb(void *userdata, MovieTrackingTrack *track, immUniformColor4fv(col); if (is_point) { - immBeginAtMost(GL_POINTS, 1); + immBeginAtMost(PRIM_POINTS, 1); } else { /* Graph can be composed of smaller segments, if any marker is disabled */ - immBeginAtMost(GL_LINE_STRIP, track->markersnr); + immBeginAtMost(PRIM_LINE_STRIP, track->markersnr); } } @@ -236,11 +236,11 @@ static void tracking_error_segment_start_cb(void *userdata, MovieTrackingTrack * immUniformColor4fv(col); if (is_point) { /* This probably never happens here, but just in case... */ - immBeginAtMost(GL_POINTS, 1); + immBeginAtMost(PRIM_POINTS, 1); } else { /* Graph can be composed of smaller segments, if any marker is disabled */ - immBeginAtMost(GL_LINE_STRIP, track->markersnr); + immBeginAtMost(PRIM_LINE_STRIP, track->markersnr); } } } @@ -299,7 +299,7 @@ static void draw_frame_curves(SpaceClip *sc, unsigned int pos) } if (!lines) { - immBeginAtMost(GL_LINE_STRIP, reconstruction->camnr); + immBeginAtMost(PRIM_LINE_STRIP, reconstruction->camnr); lines = 1; } diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index a5096d3f171..462be829a23 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -252,7 +252,7 @@ void clip_draw_cfra(SpaceClip *sc, ARegion *ar, Scene *scene) immUniformThemeColor(TH_CFRAME); glLineWidth(2.0f); - immBegin(GL_LINES, 2); + immBegin(PRIM_LINES, 2); immVertex2f(pos, x, v2d->cur.ymin); immVertex2f(pos, x, v2d->cur.ymax); immEnd(); @@ -295,7 +295,7 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene) /* thin lines where the actual frames are */ glLineWidth(1.0f); - immBegin(GL_LINES, 4); + immBegin(PRIM_LINES, 4); immVertex2f(pos, (float)SFRA, v2d->cur.ymin); immVertex2f(pos, (float)SFRA, v2d->cur.ymax); immVertex2f(pos, (float)EFRA, v2d->cur.ymin); |