Make build with GL 3.3 again
This is a workaround while the PRIM_QUADS_XXX are still in the code
This commit is contained in:
parent
b6ba507c1b
commit
f87815705b
@ -206,6 +206,7 @@ static void blf_font_draw_ex(
|
||||
|
||||
blf_font_ensure_ascii_table(font);
|
||||
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
immBeginAtMost(PRIM_QUADS_XXX, verts_needed(font, str, len));
|
||||
/* at most because some glyphs might be clipped & not drawn */
|
||||
|
||||
@ -227,6 +228,7 @@ static void blf_font_draw_ex(
|
||||
}
|
||||
|
||||
immEnd();
|
||||
#endif
|
||||
|
||||
if (r_info) {
|
||||
r_info->lines = 1;
|
||||
@ -253,6 +255,7 @@ static void blf_font_draw_ascii_ex(
|
||||
|
||||
blf_font_ensure_ascii_table(font);
|
||||
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
immBeginAtMost(PRIM_QUADS_XXX, verts_needed(font, str, len));
|
||||
|
||||
while ((c = *(str++)) && len--) {
|
||||
@ -270,6 +273,7 @@ static void blf_font_draw_ascii_ex(
|
||||
}
|
||||
|
||||
immEnd();
|
||||
#endif
|
||||
|
||||
if (r_info) {
|
||||
r_info->lines = 1;
|
||||
@ -293,6 +297,7 @@ int blf_font_draw_mono(FontBLF *font, const char *str, size_t len, int cwidth)
|
||||
|
||||
blf_font_ensure_ascii_table(font);
|
||||
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
immBeginAtMost(PRIM_QUADS_XXX, verts_needed(font, str, len));
|
||||
|
||||
while ((i < len) && str[i]) {
|
||||
@ -315,6 +320,7 @@ int blf_font_draw_mono(FontBLF *font, const char *str, size_t len, int cwidth)
|
||||
}
|
||||
|
||||
immEnd();
|
||||
#endif
|
||||
|
||||
return columns;
|
||||
}
|
||||
|
@ -740,6 +740,7 @@ static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thi
|
||||
unsigned int color = VertexFormat_add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT);
|
||||
|
||||
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
immBegin(PRIM_QUADS_XXX, (totpoints - 2) * 4 + 12);
|
||||
|
||||
for (i = 0, pt1 = points, pt2 = points + 1; i < (totpoints - 1); i++, pt1++, pt2++) {
|
||||
@ -882,6 +883,7 @@ static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thi
|
||||
/* store stroke's 'natural' normal for next stroke to use */
|
||||
copy_v2_v2(pm, m2);
|
||||
}
|
||||
#endif
|
||||
|
||||
immEnd();
|
||||
immUnbindProgram();
|
||||
|
@ -1957,6 +1957,7 @@ void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx,
|
||||
|
||||
immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
|
||||
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
immBegin(PRIM_QUADS_XXX, 36);
|
||||
|
||||
/* accumulated outline boxes to make shade not linear, is more pleasant */
|
||||
@ -1965,6 +1966,7 @@ void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx,
|
||||
ui_shadowbox(pos, color, minx, miny, maxx, maxy, 5.0, (80 * alpha) >> 8);
|
||||
|
||||
immEnd();
|
||||
#endif
|
||||
|
||||
immUnbindProgram();
|
||||
|
||||
|
@ -1799,6 +1799,7 @@ static void outliner_back(ARegion *ar)
|
||||
int tot = (int)floor(ystart - ar->v2d.cur.ymin + 2 * UI_UNIT_Y) / (2 * UI_UNIT_Y);
|
||||
|
||||
if (tot > 0) {
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
immBegin(PRIM_QUADS_XXX, 4 * tot);
|
||||
while (tot--) {
|
||||
y1 -= 2 * UI_UNIT_Y;
|
||||
@ -1809,6 +1810,7 @@ static void outliner_back(ARegion *ar)
|
||||
immVertex2f(pos, x1, y2);
|
||||
}
|
||||
immEnd();
|
||||
#endif
|
||||
}
|
||||
immUnbindProgram();
|
||||
}
|
||||
|
@ -214,6 +214,7 @@ static void time_draw_cache(SpaceTime *stime, Object *ob, Scene *scene)
|
||||
|
||||
immUniformColor4fv(col);
|
||||
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
if (len > 0) {
|
||||
immBeginAtMost(PRIM_QUADS_XXX, len);
|
||||
|
||||
@ -229,6 +230,7 @@ static void time_draw_cache(SpaceTime *stime, Object *ob, Scene *scene)
|
||||
|
||||
immEnd();
|
||||
}
|
||||
#endif
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
|
@ -1894,6 +1894,7 @@ static void drawcamera_volume(float near_plane[4][3], float far_plane[4][3], boo
|
||||
drawcamera_frame(far_plane, filled, pos);
|
||||
|
||||
if (filled) {
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
immBegin(PRIM_QUADS_XXX, 16); /* TODO(merwin): use PRIM_TRIANGLE_STRIP here */
|
||||
immVertex3fv(pos, near_plane[0]);
|
||||
immVertex3fv(pos, far_plane[0]);
|
||||
@ -1915,6 +1916,7 @@ static void drawcamera_volume(float near_plane[4][3], float far_plane[4][3], boo
|
||||
immVertex3fv(pos, near_plane[3]);
|
||||
immVertex3fv(pos, far_plane[3]);
|
||||
immEnd();
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
immBegin(PRIM_LINES, 8);
|
||||
@ -5633,7 +5635,9 @@ static void draw_particle_arrays_new(int draw_as, int ob_dt, int select,
|
||||
else
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
draw_vertex_array(PRIM_QUADS_XXX, vert, nor, color, 0, 4 * totpoint, col);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
draw_vertex_array(PRIM_POINTS, vert, nor, color, 0, totpoint, col);
|
||||
@ -7990,7 +7994,11 @@ static void imm_draw_box(const float vec[8][3], bool solid, unsigned pos)
|
||||
|
||||
if (solid) {
|
||||
indices = quad_indices;
|
||||
#ifdef WITH_GL_PROFILE_COMPAT
|
||||
prim_type = PRIM_QUADS_XXX;
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
indices = line_indices;
|
||||
|
Loading…
Reference in New Issue
Block a user