Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_graph/graph_draw.c
| Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, | ||||
| immEnd(); | immEnd(); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| if (env->totvert > 0) { | if (env->totvert > 0) { | ||||
| /* set size of vertices (non-adjustable for now) */ | /* set size of vertices (non-adjustable for now) */ | ||||
| GPU_point_size(2.0f); | GPU_point_size(2.0f); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| /* for now, point color is fixed, and is white */ | /* for now, point color is fixed, and is white */ | ||||
| immUniformColor3f(1.0f, 1.0f, 1.0f); | immUniformColor3f(1.0f, 1.0f, 1.0f); | ||||
| immBeginAtMost(GPU_PRIM_POINTS, env->totvert * 2); | immBeginAtMost(GPU_PRIM_POINTS, env->totvert * 2); | ||||
| for (i = 0, fed = env->data; i < env->totvert; i++, fed++) { | for (i = 0, fed = env->data; i < env->totvert; i++, fed++) { | ||||
| const float env_scene_time = BKE_nla_tweakedit_remap( | const float env_scene_time = BKE_nla_tweakedit_remap( | ||||
| ▲ Show 20 Lines • Show All 416 Lines • ▼ Show 20 Lines | static void draw_fcurve_samples(SpaceGraph *sipo, ARegion *region, FCurve *fcu) | ||||
| if (first && last) { | if (first && last) { | ||||
| /* anti-aliased lines for more consistent appearance */ | /* anti-aliased lines for more consistent appearance */ | ||||
| if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { | if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| } | } | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformThemeColor((fcu->flag & FCURVE_SELECTED) ? TH_TEXT_HI : TH_TEXT); | immUniformThemeColor((fcu->flag & FCURVE_SELECTED) ? TH_TEXT_HI : TH_TEXT); | ||||
| draw_fcurve_sample_control(first->vec[0], first->vec[1], xscale, yscale, hsize, pos); | draw_fcurve_sample_control(first->vec[0], first->vec[1], xscale, yscale, hsize, pos); | ||||
| draw_fcurve_sample_control(last->vec[0], last->vec[1], xscale, yscale, hsize, pos); | draw_fcurve_sample_control(last->vec[0], last->vec[1], xscale, yscale, hsize, pos); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| ▲ Show 20 Lines • Show All 711 Lines • ▼ Show 20 Lines | if (x >= v2d->cur.xmin) { | ||||
| co[0] = x; | co[0] = x; | ||||
| immVertex2fv(shdr_pos, co); | immVertex2fv(shdr_pos, co); | ||||
| immEnd(); | immEnd(); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| /* GPU_PRIM_POINTS do not survive dashed line geometry shader... */ | /* GPU_PRIM_POINTS do not survive dashed line geometry shader... */ | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| /* x marks the spot .................................................... */ | /* x marks the spot .................................................... */ | ||||
| /* -> outer frame */ | /* -> outer frame */ | ||||
| immUniformColor3f(0.9f, 0.9f, 0.9f); | immUniformColor3f(0.9f, 0.9f, 0.9f); | ||||
| GPU_point_size(7.0); | GPU_point_size(7.0); | ||||
| immBegin(GPU_PRIM_POINTS, 1); | immBegin(GPU_PRIM_POINTS, 1); | ||||
| immVertex2f(shdr_pos, x, y); | immVertex2f(shdr_pos, x, y); | ||||
| ▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines | |||||