Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/anim_draw.c
| Context not available. | |||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| #include "GPU_immediate.h" | |||||
| /* *************************************************** */ | /* *************************************************** */ | ||||
| /* CURRENT FRAME DRAWING */ | /* CURRENT FRAME DRAWING */ | ||||
| Context not available. | |||||
| x = cfra * xscale; | x = cfra * xscale; | ||||
| y = 0.9f * U.widget_unit; | y = 0.9f * U.widget_unit; | ||||
| VertexFormat *format = immVertexFormat(); | |||||
| unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | |||||
merwin: This calls glColor indirectly, so must be changed. You can use immUniformThemeColorShade after… | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | |||||
| /* draw green box around/behind text */ | /* draw green box around/behind text */ | ||||
| UI_ThemeColorShade(TH_CFRAME, 0); | immUniformThemeColorShade(TH_CFRAME, 0); | ||||
| glRectf(x, y, x + slen, y + 0.75f * U.widget_unit); | |||||
| immRectf(pos, x, y, x + slen, y + 0.75f * U.widget_unit); | |||||
| immUnbindProgram(); | |||||
| /* draw current frame number - black text */ | /* draw current frame number - black text */ | ||||
| UI_ThemeColor(TH_TEXT); | UI_ThemeColor(TH_TEXT); | ||||
| Context not available. | |||||
| glLineWidth((flag & DRAWCFRA_WIDE) ? 3.0 : 2.0); | glLineWidth((flag & DRAWCFRA_WIDE) ? 3.0 : 2.0); | ||||
| glBegin(GL_LINES); | VertexFormat *format = immVertexFormat(); | ||||
| glVertex2f(x, v2d->cur.ymin - 500.0f); /* XXX arbitrary... want it go to bottom */ | unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | ||||
| glVertex2f(x, v2d->cur.ymax); | |||||
| glEnd(); | immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | ||||
merwinUnsubmitted Done Inline ActionsimmUniformThemeColor(TH_CFRAME); here instead of UI_ThemeColor(TH_CFRAME); above. merwin: immUniformThemeColor(TH_CFRAME);
here instead of
UI_ThemeColor(TH_CFRAME);
above.
| |||||
| immBegin(GL_LINES, 2); | |||||
| immVertex2f(pos, x, v2d->cur.ymin - 500.0f); /* XXX arbitrary... want it go to bottom */ | |||||
| immVertex2f(pos, x, v2d->cur.ymax); | |||||
| immEnd(); | |||||
| immUnbindProgram(); | |||||
| /* Draw current frame number in a little box */ | /* Draw current frame number in a little box */ | ||||
| if (flag & DRAWCFRA_SHOW_NUMBOX) { | if (flag & DRAWCFRA_SHOW_NUMBOX) { | ||||
| Context not available. | |||||
| if (PRVRANGEON) { | if (PRVRANGEON) { | ||||
| glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | ||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| glColor4f(0.0f, 0.0f, 0.0f, 0.4f); | |||||
| VertexFormat *format = immVertexFormat(); | |||||
| unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | |||||
Done Inline ActionsWe were thinking the same thing! Now this color attribute is not needed. merwin: We were thinking the same thing!
Now this color attribute is not needed. | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | |||||
| immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f); | |||||
| /* only draw two separate 'curtains' if there's no overlap between them */ | /* only draw two separate 'curtains' if there's no overlap between them */ | ||||
| if (PSFRA < PEFRA + end_frame_width) { | if (PSFRA < PEFRA + end_frame_width) { | ||||
| glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax); | immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax); | ||||
| glRectf((float)(PEFRA + end_frame_width), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); | immRectf(pos, (float)(PEFRA + end_frame_width), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); | ||||
| } | } | ||||
| else { | else { | ||||
| glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); | immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); | ||||
| } | } | ||||
Done Inline ActionsSince you're using uniform color, do this once after immBind... immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f); Then call immRectf below. merwin: Since you're using uniform color, do this once after immBind...
```
immUniformColor4f(0.0f, 0. | |||||
| immUnbindProgram(); | |||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
This calls glColor indirectly, so must be changed. You can use immUniformThemeColorShade after binding GPU_SHADER_2D_UNIFORM_COLOR.