summaryrefslogtreecommitdiff
path: root/src/drivers/OpenGL
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/OpenGL')
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H12
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx4
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx13
3 files changed, 22 insertions, 7 deletions
diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
index f5de05333..46dba5388 100644
--- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
+++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
@@ -50,8 +50,6 @@ public:
int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
int not_clipped(int x, int y, int w, int h);
void restore_clip();
- // --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
- //void transformed_vertex0(double x, double y);
void transformed_vertex(double xf, double yf);
void vertex(double x, double y);
void begin_points();
@@ -67,21 +65,21 @@ public:
void end_complex_polygon();
void fixloop();
void circle(double x, double y, double r);
- // --- implementation is in src/fl_arc.cxx which includes src/cfg_gfx/xxx_arc.cxx if needed
- // using void Fl_Graphics_Driver::arc(double x, double y, double r, double start, double end);
- // --- implementation is in src/fl_arci.cxx which includes src/cfg_gfx/xxx_arci.cxx
void arc(int x, int y, int w, int h, double a1, double a2);
+ void arc(double x, double y, double r, double start, double end);
void pie(int x, int y, int w, int h, double a1, double a2);
- // --- implementation is in src/fl_line_style.cxx which includes src/cfg_gfx/xxx_line_style.cxx
void line_style(int style, int width=0, char* dashes=0);
- // --- implementation is in src/fl_color.cxx which includes src/cfg_gfx/xxx_color.cxx
void color(Fl_Color c);
Fl_Color color() { return color_; }
void color(uchar r, uchar g, uchar b);
// --- implementation is in Fl_OpenGL_Graphics_Driver_font.cxx
void font(Fl_Font face, Fl_Fontsize fsize);
+ Fl_Font font();
void draw(const char *str, int n, int x, int y);
+ void draw(const char *str, int n, float x, float y);
+ void draw(int angle, const char *str, int n, int x, int y);
double width(const char *str, int n);
+ double width(unsigned int c);
void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
int height();
int descent();
diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx
index ba5a7e7d7..f933d10e2 100644
--- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx
+++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx
@@ -46,6 +46,10 @@ void Fl_OpenGL_Graphics_Driver::arc(int x,int y,int w,int h,double a1,double a2)
glEnd();
}
+void Fl_OpenGL_Graphics_Driver::arc(double x, double y, double r, double start, double end) {
+ Fl_Graphics_Driver::arc(x, y, r, start, end);
+}
+
void Fl_OpenGL_Graphics_Driver::pie(int x,int y,int w,int h,double a1,double a2) {
if (w <= 0 || h <= 0) return;
while (a2<a1) a2 += 360.0; // TODO: write a sensible fmod angle alignment here
diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx
index fc6bc48c1..c6a266b96 100644
--- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx
+++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx
@@ -172,11 +172,22 @@ FL_EXPORT int glutStrokeWidth(void *font, int character);
// use gl_font()/gl_draw() to draw GL text
void Fl_OpenGL_Graphics_Driver::font(Fl_Font face, Fl_Fontsize fsize) {
+ Fl_Graphics_Driver::font(face, fsize);
Fl_Surface_Device::push_current(Fl_Display_Device::display_device());
gl_font(face, fsize);
Fl_Surface_Device::pop_current();
}
+Fl_Font Fl_OpenGL_Graphics_Driver::font() {
+ return Fl_Graphics_Driver::font();
+}
+
+void Fl_OpenGL_Graphics_Driver::draw(const char *str, int n, float x, float y) {
+ this->draw(str, n, int(x), int(y));
+}
+
+void Fl_OpenGL_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) {}
+
void Fl_OpenGL_Graphics_Driver::draw(const char* str, int n, int x, int y) {
Fl_Surface_Device::push_current(Fl_Display_Device::display_device());
gl_draw(str, n, x, y);
@@ -190,6 +201,8 @@ double Fl_OpenGL_Graphics_Driver::width(const char *str, int n) {
return w;
}
+double Fl_OpenGL_Graphics_Driver::width(unsigned int c) { return Fl_Graphics_Driver::width(c); }
+
int Fl_OpenGL_Graphics_Driver::descent() {
Fl_Surface_Device::push_current(Fl_Display_Device::display_device());
int d = fl_descent();