Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Gl_Window.h

00001 /*
00002  * $Id: Fl_Gl_Window.h,v 1.2 2003/01/09 16:12:26 laza2000 Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Mikko Lahteenmaki
00016  * Email  : mikko@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef _FL_GL_WINDOW_H_
00023 #define _FL_GL_WINDOW_H_
00024 
00025 #include "Fl_Window.h"
00026 
00027 #ifndef GLContext
00028 typedef void* GLContext; // actually a GLXContext or HGLDC
00029 #endif
00030 
00031 class Fl_Gl_Choice; // structure to hold result of glXChooseVisual
00032 
00033 enum {
00034     FL_NO_AUTO_SWAP = 1024,
00035     FL_NO_ERASE_OVERLAY = 2048
00036 };
00037 
00038 class FL_API Fl_Gl_Window : public Fl_Window {
00039 
00040 public:
00041     Fl_Gl_Window(int W, int H, const char *l=0) : Fl_Window(W,H,l) { init(); }
00042     Fl_Gl_Window(int X, int Y, int W, int H, const char *l=0) : Fl_Window(X,Y,W,H,l) { init(); }
00043     ~Fl_Gl_Window();
00044 
00045     virtual void create();
00046     virtual void flush();
00047     virtual void destroy();
00048     virtual void layout();
00049 
00050     char valid() const {return valid_;}
00051     void valid(char i) {valid_ = i;}
00052     void invalidate();
00053 
00054     int mode() const {return mode_;}
00055     bool mode(int a);
00056     static bool can_do(int);
00057     bool can_do() {return can_do(mode_);}
00058 
00059     void* context() const {return context_;}
00060     void context(void*, bool destroy_flag = false);
00061     void make_current();
00062     void swap_buffers();
00063     void ortho();
00064 
00065     bool can_do_overlay();
00066     void redraw_overlay();
00067     void hide_overlay();
00068     void make_overlay_current();
00069 
00070 private:
00071     int mode_;
00072     Fl_Gl_Choice *gl_choice;
00073     GLContext context_;
00074     char valid_;
00075     char damage1_; // damage() of back buffer
00076     virtual void draw_overlay();
00077     void init();
00078 
00079     void *overlay;
00080     void make_overlay();
00081     friend class _Fl_Gl_Overlay;
00082 
00083     void draw_swap();
00084 };
00085 
00086 #endif

Generated on Thu Jul 31 15:33:43 2003 for eFLTK by doxygen1.2.15