summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Window.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-01-21 16:38:14 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-01-21 16:38:14 +0000
commit42845966d1502bae8c24bf35aff1dcf11a1e058d (patch)
tree152b7f1a40727ed098a1fe74b2c50a2ad51bf820 /src/Fl_Gl_Window.cxx
parent5ff6efd52913ba1d3ec6f22bc61e416a26e70361 (diff)
Removed OpenGL graphics driver from public view. For the parts that are implemented, it will 'just work' by allowing fl_* rendering into OpenGL contexts (such as widgets, etc.)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11022 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Window.cxx')
-rw-r--r--src/Fl_Gl_Window.cxx199
1 files changed, 0 insertions, 199 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 82b38fd14..9a8398a68 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -41,205 +41,6 @@ extern int fl_gl_load_plugin;
#endif
-// ------ this should be in a separate file! -----------------------------------
-#ifdef FL_CFG_GFX_OPENGL
-
-#include <FL/Fl_Device.H>
-#include <FL/gl.h>
-
-/**
- \brief OpenGL pecific graphics class.
- *
- This class is implemented only on the Mac OS X platform.
- */
-class FL_EXPORT Fl_OpenGL_Graphics_Driver : public Fl_Graphics_Driver {
-public:
- static const char *class_id;
- const char *class_name() {return class_id;};
- void draw(const char* str, int n, int x, int y) {
- gl_draw(str, n, x, y);
- }
- void color(Fl_Color c) {
- gl_color(c);
- }
- void color(uchar r, uchar g, uchar b) {
- unsigned int c = (r<<24)|(g<<16)|(b<<8);
- gl_color(c);
- }
- // --- implementation will eventually be in src/fl_rect.cxx which includes src/cfg_gfx/xlib_rect.cxx
- // --- line and polygon drawing with integer coordinates
- void point(int x, int y) {
- glBegin(GL_POINTS);
- glVertex2i(x, y);
- glEnd();
- }
- void rect(int x, int y, int w, int h) {
- glBegin(GL_LINE_LOOP);
- glVertex2i(x, y);
- glVertex2i(x+w, y);
- glVertex2i(x+w, y+h);
- glVertex2i(x, y+h);
- glEnd();
- }
- void rectf(int x, int y, int w, int h) {
- if (w<=0 || h<=0) return;
- // OpenGL has the natural origin at the bottom left. Drawing in FLTK
- // coordinates requires that we shift the rectangle one pixel up.
- glBegin(GL_POLYGON);
- glVertex2i(x, y-1);
- glVertex2i(x+w, y-1);
- glVertex2i(x+w, y+h-1);
- glVertex2i(x, y+h-1);
- glEnd();
- }
- void line(int x, int y, int x1, int y1) {
- glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x1, y1);
- glEnd();
- point(x1, y1);
- }
- void line(int x, int y, int x1, int y1, int x2, int y2) {
- glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x1, y1);
- glVertex2i(x2, y2);
- glEnd();
- point(x2, y2);
- }
- void xyline(int x, int y, int x1) {
- glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x1, y);
- glEnd();
- point(x1, y);
- }
- void xyline(int x, int y, int x1, int y2) {
- glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x1, y);
- glVertex2i(x1, y2);
- glEnd();
- point(x1, y2);
- }
- void xyline(int x, int y, int x1, int y2, int x3) {
- glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x1, y);
- glVertex2i(x1, y2);
- glVertex2i(x3, y2);
- glEnd();
- point(x3, y2);
- }
- void yxline(int x, int y, int y1) {
- glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x, y1);
- glEnd();
- point(x, y1);
- }
- void yxline(int x, int y, int y1, int x2) {
- glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x, y1);
- glVertex2i(x2, y1);
- glEnd();
- point(x2, y1);
- }
- void yxline(int x, int y, int y1, int x2, int y3) {
- glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x, y1);
- glVertex2i(x2, y1);
- glVertex2i(x2, y3);
- glEnd();
- point(x2, y3);
- }
- void loop(int x0, int y0, int x1, int y1, int x2, int y2) {
- glBegin(GL_LINE_LOOP);
- glVertex2i(x0, y0);
- glVertex2i(x1, y1);
- glVertex2i(x2, y2);
- glEnd();
- }
- void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) {
- glBegin(GL_LINE_LOOP);
- glVertex2i(x0, y0);
- glVertex2i(x1, y1);
- glVertex2i(x2, y2);
- glVertex2i(x3, y3);
- glEnd();
- }
- void polygon(int x0, int y0, int x1, int y1, int x2, int y2) {
- glBegin(GL_POLYGON);
- glVertex2i(x0, y0);
- glVertex2i(x1, y1);
- glVertex2i(x2, y2);
- glEnd();
- }
- void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) {
- glBegin(GL_POLYGON);
- glVertex2i(x0, y0);
- glVertex2i(x1, y1);
- glVertex2i(x2, y2);
- glVertex2i(x3, y3);
- glEnd();
- }
- void push_clip(int x, int y, int w, int h) {
- // TODO: implement OpenGL clipping
- if (rstackptr < region_stack_max) rstack[++rstackptr] = 0L;
- else Fl::warning("Fl_OpenGL_Graphics_Driver::push_clip: clip stack overflow!\n");
- }
- int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) {
- // TODO: implement OpenGL clipping
- X = x; Y = y; W = w, H = h;
- return 0;
- }
- int not_clipped(int x, int y, int w, int h) {
- // TODO: implement OpenGL clipping
- return 1;
- }
- void push_no_clip() {
- // TODO: implement OpenGL clipping
- if (rstackptr < region_stack_max) rstack[++rstackptr] = 0;
- else Fl::warning("Fl_OpenGL_Graphics_Driver::push_no_clip: clip stack overflow!\n");
- restore_clip();
- }
- void pop_clip() {
- // TODO: implement OpenGL clipping
- if (rstackptr > 0) {
- rstackptr--;
- } else Fl::warning("Fl_OpenGL_Graphics_Driver::pop_clip: clip stack underflow!\n");
- restore_clip();
- }
- void restore_clip() {
- // TODO: implement OpenGL clipping
- fl_clip_state_number++;
- }
-};
-
-const char *Fl_OpenGL_Graphics_Driver::class_id = "Fl_OpenGL_Graphics_Driver";
-
-Fl_OpenGL_Display_Device *Fl_OpenGL_Display_Device::display_device() {
- static Fl_OpenGL_Display_Device *display = new Fl_OpenGL_Display_Device(new Fl_OpenGL_Graphics_Driver());
- return display;
-};
-
-
-Fl_OpenGL_Display_Device::Fl_OpenGL_Display_Device(Fl_OpenGL_Graphics_Driver *graphics_driver)
-: Fl_Surface_Device(graphics_driver)
-{
-}
-
-
-const char *Fl_OpenGL_Display_Device::class_id = "Fl_OpenGL_Display_Device";
-
-
-
-#endif
-// ------ end of separate file! ------------------------------------------------
-
-
////////////////////////////////////////////////////////////////
// The symbol SWAP_TYPE defines what is in the back buffer after doing