Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2016-08-20 22:40:08 +0300
committerMike Erwin <significant.bit@gmail.com>2016-08-20 22:40:08 +0300
commitbe2bc7e0f66b9ed1c863790b3555aa3e7db4cb76 (patch)
tree6662e4f1aea3e627d1c0cc3a5e2621229063a094 /source/blender/editors/screen/glutil.c
parenteb717ee9794a0e3c217f7e6f32904a115fc6e9e1 (diff)
OpenGL: draw color picker wheel with new immediate mode
Includes new imm_draw_lined_circle function that can be used for other widgets. Part of T49043
Diffstat (limited to 'source/blender/editors/screen/glutil.c')
-rw-r--r--source/blender/editors/screen/glutil.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index b99927cea41..3ed89ed8a07 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -49,6 +49,7 @@
#include "IMB_imbuf_types.h"
#include "GPU_basic_shader.h"
+#include "GPU_immediate.h"
#include "UI_interface.h"
@@ -181,6 +182,17 @@ void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments
glEnd();
}
+void imm_draw_lined_circle(unsigned pos, float x, float y, float rad, int nsegments)
+{
+ immBegin(GL_LINE_LOOP, nsegments);
+ for (int i = 0; i < nsegments; ++i) {
+ float angle = 2 * M_PI * ((float)i / (float)nsegments);
+ immVertex2f(pos, x + rad * cosf(angle),
+ y + rad * sinf(angle));
+ }
+ immEnd();
+}
+
float glaGetOneFloat(int param)
{
GLfloat v;