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:
authorMike Erwin <significant.bit@gmail.com>2017-04-07 23:31:26 +0300
committerMike Erwin <significant.bit@gmail.com>2017-04-07 23:31:26 +0300
commitbd3a1b9490d96ca00748f405037379b743744877 (patch)
treeaed8ff42fb92cc78de6729cd6d90c3c5ee9ad8ca /source/blender/editors/screen
parentc1dc078840541bd64f95fdeca52267c75a061e04 (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/screen')
-rw-r--r--source/blender/editors/screen/area.c12
-rw-r--r--source/blender/editors/screen/glutil.c10
-rw-r--r--source/blender/editors/screen/screen_draw.c16
3 files changed, 19 insertions, 19 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 78c8619034c..599daef6661 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -97,7 +97,7 @@ static void region_draw_emboss(const ARegion *ar, const rcti *scirct)
unsigned int color = VertexFormat_add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
- immBegin(GL_LINE_STRIP, 5);
+ immBegin(PRIM_LINE_STRIP, 5);
/* right */
immAttrib4ub(color, 0, 0, 0, 30);
@@ -231,7 +231,7 @@ static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, f
imm_draw_line_box(pos, click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax);
immAttrib4ub(color, 0, 255, 255, alpha_debug);
- immBegin(GL_LINES, 4);
+ immBegin(PRIM_LINES, 4);
immVertex2f(pos, click_rect.xmin, click_rect.ymin);
immVertex2f(pos, click_rect.xmax, click_rect.ymax);
immVertex2f(pos, click_rect.xmin, click_rect.ymax);
@@ -260,7 +260,7 @@ static void area_draw_azone(short x1, short y1, short x2, short y2)
unsigned int col = VertexFormat_add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
- immBegin(GL_LINES, 12);
+ immBegin(PRIM_LINES, 12);
immAttrib4ub(col, 255, 255, 255, 180);
immVertex2f(pos, x1, y2);
@@ -307,7 +307,7 @@ static void region_draw_azone_icon(AZone *az)
immUniform4f("outlineColor", 0.2f, 0.2f, 0.2f, 0.9f);
immUniform1f("outlineWidth", 1.0f);
immUniform1f("size", 9.5f);
- immBegin(GL_POINTS, 1);
+ immBegin(PRIM_POINTS, 1);
immVertex2f(pos, midx, midy);
immEnd();
immUnbindProgram();
@@ -316,7 +316,7 @@ static void region_draw_azone_icon(AZone *az)
/* + */
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniform4f("color", 0.2f, 0.2f, 0.2f, 0.9f);
- immBegin(GL_LINES, 4);
+ immBegin(PRIM_LINES, 4);
immVertex2f(pos, midx, midy - 2);
immVertex2f(pos, midx, midy + 3);
immVertex2f(pos, midx - 2, midy);
@@ -2443,7 +2443,7 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy)
unsigned color = VertexFormat_add_attrib(format, "color", COMP_F32, 3, KEEP_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
- immBegin(GL_LINES, 4 * count_fine + 4 * count_large);
+ immBegin(PRIM_LINES, 4 * count_fine + 4 * count_large);
float theme_color[3];
UI_GetThemeColorShade3fv(TH_BACK, (int)(20.0f * (1.0f - blendfac)), theme_color);
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index f9e7a27e337..7387d9481d5 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -300,7 +300,7 @@ void immDrawPixelsTexScaled_clipping(float x, float y, int img_w, int img_h,
glTexSubImage2D(GL_TEXTURE_2D, 0, subpart_w, subpart_h, 1, 1, format, GL_UNSIGNED_BYTE, &uc_rect[(((size_t)subpart_y) * offset_y + subpart_h - 1) * img_w * components + (subpart_x * offset_x + subpart_w - 1) * components]);
}
- immBegin(GL_TRIANGLE_FAN, 4);
+ immBegin(PRIM_TRIANGLE_FAN, 4);
immAttrib2f(texco, (float)(0 + offset_left) / tex_w, (float)(0 + offset_bot) / tex_h);
immVertex2f(pos, rast_x + (float)offset_left * xzoom, rast_y + (float)offset_bot * yzoom);
@@ -695,28 +695,28 @@ void immDrawBorderCorners(unsigned int pos, const rcti *border, float zoomx, flo
delta_y = min_ff(delta_y, border->ymax - border->ymin);
/* left bottom corner */
- immBegin(GL_LINE_STRIP, 3);
+ immBegin(PRIM_LINE_STRIP, 3);
immVertex2f(pos, border->xmin, border->ymin + delta_y);
immVertex2f(pos, border->xmin, border->ymin);
immVertex2f(pos, border->xmin + delta_x, border->ymin);
immEnd();
/* left top corner */
- immBegin(GL_LINE_STRIP, 3);
+ immBegin(PRIM_LINE_STRIP, 3);
immVertex2f(pos, border->xmin, border->ymax - delta_y);
immVertex2f(pos, border->xmin, border->ymax);
immVertex2f(pos, border->xmin + delta_x, border->ymax);
immEnd();
/* right bottom corner */
- immBegin(GL_LINE_STRIP, 3);
+ immBegin(PRIM_LINE_STRIP, 3);
immVertex2f(pos, border->xmax - delta_x, border->ymin);
immVertex2f(pos, border->xmax, border->ymin);
immVertex2f(pos, border->xmax, border->ymin + delta_y);
immEnd();
/* right top corner */
- immBegin(GL_LINE_STRIP, 3);
+ immBegin(PRIM_LINE_STRIP, 3);
immVertex2f(pos, border->xmax - delta_x, border->ymax);
immVertex2f(pos, border->xmax, border->ymax);
immVertex2f(pos, border->xmax, border->ymax - delta_y);
diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c
index 31acaecf029..4e43a7f96e7 100644
--- a/source/blender/editors/screen/screen_draw.c
+++ b/source/blender/editors/screen/screen_draw.c
@@ -94,7 +94,7 @@ static void draw_horizontal_join_shape(ScrArea *sa, char dir, unsigned int pos)
}
}
- immBegin(GL_TRIANGLE_FAN, 5);
+ immBegin(PRIM_TRIANGLE_FAN, 5);
for (i = 0; i < 5; i++) {
immVertex2f(pos, points[i].x, points[i].y);
@@ -102,7 +102,7 @@ static void draw_horizontal_join_shape(ScrArea *sa, char dir, unsigned int pos)
immEnd();
- immBegin(GL_TRIANGLE_FAN, 5);
+ immBegin(PRIM_TRIANGLE_FAN, 5);
for (i = 4; i < 8; i++) {
immVertex2f(pos, points[i].x, points[i].y);
@@ -175,7 +175,7 @@ static void draw_vertical_join_shape(ScrArea *sa, char dir, unsigned int pos)
}
}
- immBegin(GL_TRIANGLE_FAN, 5);
+ immBegin(PRIM_TRIANGLE_FAN, 5);
for (i = 0; i < 5; i++) {
immVertex2f(pos, points[i].x, points[i].y);
@@ -183,7 +183,7 @@ static void draw_vertical_join_shape(ScrArea *sa, char dir, unsigned int pos)
immEnd();
- immBegin(GL_TRIANGLE_FAN, 5);
+ immBegin(PRIM_TRIANGLE_FAN, 5);
for (i = 4; i < 8; i++) {
immVertex2f(pos, points[i].x, points[i].y);
@@ -246,7 +246,7 @@ static void drawscredge_area_draw(int sizex, int sizey, short x1, short y1, shor
return;
}
- immBegin(GL_LINES, count);
+ immBegin(PRIM_LINES, count);
/* right border area */
if (x2 < sizex - 1) {
@@ -367,7 +367,7 @@ void ED_screen_draw(wmWindow *win)
glEnable(GL_BLEND);
immUniformColor4ub(255, 255, 255, 100);
- immBegin(GL_LINES, 2);
+ immBegin(PRIM_LINES, 2);
if (sa3->flag & AREA_FLAG_DRAWSPLIT_H) {
immVertex2f(pos, sa3->totrct.xmin, win->eventstate->y);
@@ -377,7 +377,7 @@ void ED_screen_draw(wmWindow *win)
immUniformColor4ub(0, 0, 0, 100);
- immBegin(GL_LINES, 2);
+ immBegin(PRIM_LINES, 2);
immVertex2f(pos, sa3->totrct.xmin, win->eventstate->y + 1);
immVertex2f(pos, sa3->totrct.xmax, win->eventstate->y + 1);
@@ -390,7 +390,7 @@ void ED_screen_draw(wmWindow *win)
immUniformColor4ub(0, 0, 0, 100);
- immBegin(GL_LINES, 2);
+ immBegin(PRIM_LINES, 2);
immVertex2f(pos, win->eventstate->x + 1, sa3->totrct.ymin);
immVertex2f(pos, win->eventstate->x + 1, sa3->totrct.ymax);