diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2008-12-24 13:33:10 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2008-12-24 13:33:10 +0300 |
commit | 486de068b24bcdd562b0c0399405be36a0a73e48 (patch) | |
tree | 9e1105fe161771e72460f14bef9e780a585e2331 /source/blender/editors/screen/glutil.c | |
parent | 1d0ae960491bde2028cf28014068ba9616afe97f (diff) |
2.5 - node editor
Commit of WIP code (what code isn't wip, these days ;)
- only drawing code as basis to work further from (and have less conflicts between different systems I work on)
Diffstat (limited to 'source/blender/editors/screen/glutil.c')
-rw-r--r-- | source/blender/editors/screen/glutil.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index bead9a6399f..96cc99351fd 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -49,6 +49,34 @@ /* ******************************************** */ +void fdrawbezier(float vec[4][3]) +{ + float dist; + float curve_res = 24, spline_step = 0.0f; + + dist= 0.5f*ABS(vec[0][0] - vec[3][0]); + + /* check direction later, for top sockets */ + vec[1][0]= vec[0][0]+dist; + vec[1][1]= vec[0][1]; + + vec[2][0]= vec[3][0]-dist; + vec[2][1]= vec[3][1]; + /* we can reuse the dist variable here to increment the GL curve eval amount*/ + dist = 1.0f/curve_res; + + cpack(0x0); + glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, vec[0]); + glBegin(GL_LINE_STRIP); + while (spline_step < 1.000001f) { + /*if(do_shaded) + UI_ThemeColorBlend(th_col1, th_col2, spline_step);*/ + glEvalCoord1f(spline_step); + spline_step += dist; + } + glEnd(); +} + void fdrawline(float x1, float y1, float x2, float y2) { float v[2]; |