diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-02-12 09:56:08 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-02-12 09:56:08 +0300 |
commit | b104057d001d2472cc55c7fa51cff3275e331523 (patch) | |
tree | 02b78998050a5807d471663f63e877b747ba1507 /source/blender | |
parent | 09bfc378895f320bcc12ac5c77252f58780e73fc (diff) |
OpenGL: enable program point size for keyframes
Allows vertex shader to determine how large to rasterize each point sprite. Forgot to do this before.
Diffstat (limited to 'source/blender')
4 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 3c5f626fac4..c8d141eab07 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -52,6 +52,7 @@ #include "BKE_fcurve.h" +#include "GPU_draw.h" #include "GPU_immediate.h" #include "UI_resources.h" @@ -623,6 +624,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa unsigned int color_id = add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT); unsigned int outline_color_id = add_attrib(format, "outlineColor", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); + GPU_enable_program_point_size(); immBegin(PRIM_POINTS, key_ct); for (ActKeyColumn *ak = keys->first; ak; ak = ak->next) { @@ -633,6 +635,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa } immEnd(); + GPU_disable_program_point_size(); immUnbindProgram(); } } diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index b7eab9f2a57..a9cdb34f634 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -35,6 +35,7 @@ #include "GPU_extensions.h" #include "GPU_basic_shader.h" +#include "GPU_draw.h" #include "GPU_immediate.h" #include "BLI_blenlib.h" @@ -60,7 +61,6 @@ #include "IMB_imbuf_types.h" #include "IMB_thumbs.h" -#include "BIF_gl.h" #include "BIF_glutil.h" #include "ED_datafiles.h" @@ -262,6 +262,7 @@ static void vicon_keytype_draw_wrapper(int x, int y, int w, int h, float alpha, unsigned int outline_color_id = add_attrib(format, "outlineColor", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); + GPU_enable_program_point_size(); immBegin(PRIM_POINTS, 1); /* draw keyframe @@ -272,6 +273,7 @@ static void vicon_keytype_draw_wrapper(int x, int y, int w, int h, float alpha, pos_id, size_id, color_id, outline_color_id); immEnd(); + GPU_disable_program_point_size(); immUnbindProgram(); UI_Theme_Restore(&theme_state); diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index c381a58ba16..872e62dbc97 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -42,8 +42,6 @@ #include "ED_screen.h" #include "ED_clip.h" -#include "BIF_gl.h" - #include "WM_types.h" #include "UI_interface.h" @@ -54,6 +52,7 @@ #include "RNA_access.h" +#include "GPU_draw.h" #include "GPU_immediate.h" #include "clip_intern.h" /* own include */ @@ -221,7 +220,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) unsigned int outline_color_id = add_attrib(format, "outlineColor", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); - + GPU_enable_program_point_size(); immBegin(PRIM_POINTS, keyframe_ct); /* all same size with black outline */ @@ -276,6 +275,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) } immEnd(); + GPU_disable_program_point_size(); immUnbindProgram(); } diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 86eae70c0ff..e744a39fde9 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -146,6 +146,7 @@ static void nla_action_draw_keyframes(AnimData *adt, bAction *act, float y, floa unsigned int color_id = add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT); unsigned int outline_color_id = add_attrib(format, "outlineColor", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); + GPU_enable_program_point_size(); immBegin(PRIM_POINTS, key_ct); /* - disregard the selection status of keyframes so they draw a certain way @@ -157,6 +158,7 @@ static void nla_action_draw_keyframes(AnimData *adt, bAction *act, float y, floa } immEnd(); + GPU_disable_program_point_size(); immUnbindProgram(); } |