Move the sources to trunk
[opencv] / otherlibs / _fltk / include / FL / gl.h
1 //
2 // "$Id: gl.h,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
3 //
4 // OpenGL header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2002 by Bill Spitzak and others.
7 //
8 // You must include this instead of GL/gl.h to get the Microsoft
9 // APIENTRY stuff included (from <windows.h>) prior to the OpenGL
10 // header files.
11 //
12 // This file also provides "missing" OpenGL functions, and
13 // gl_start() and gl_finish() to allow OpenGL to be used in any window
14 //
15 // This library is free software; you can redistribute it and/or
16 // modify it under the terms of the GNU Library General Public
17 // License as published by the Free Software Foundation; either
18 // version 2 of the License, or (at your option) any later version.
19 //
20 // This library is distributed in the hope that it will be useful,
21 // but WITHOUT ANY WARRANTY; without even the implied warranty of
22 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23 // Library General Public License for more details.
24 //
25 // You should have received a copy of the GNU Library General Public
26 // License along with this library; if not, write to the Free Software
27 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
28 // USA.
29 //
30 // Please report all bugs and problems to "fltk-bugs@fltk.org".
31 //
32
33 #ifndef FL_gl_H
34 #  define FL_gl_H
35
36 #  include "Enumerations.H" // for color names
37 #  ifdef WIN32
38 #    include <windows.h>
39 #  endif
40 #  ifndef APIENTRY
41 #    if defined(__CYGWIN__)
42 #      define APIENTRY __attribute__ ((__stdcall__))
43 #    else
44 #      define APIENTRY
45 #    endif
46 #  endif
47
48 #  ifdef __APPLE__
49 #    include <OpenGL/gl.h>
50 #  else
51 #    include <GL/gl.h>
52 #  endif
53
54 FL_EXPORT void gl_start();
55 FL_EXPORT void gl_finish();
56
57 FL_EXPORT void gl_color(Fl_Color);
58 inline void gl_color(int c) {gl_color((Fl_Color)c);} // back compatability
59
60 FL_EXPORT void gl_rect(int x,int y,int w,int h);
61 inline void gl_rectf(int x,int y,int w,int h) {glRecti(x,y,x+w,y+h);}
62
63 FL_EXPORT void gl_font(int fontid, int size);
64 FL_EXPORT int  gl_height();
65 FL_EXPORT int  gl_descent();
66 FL_EXPORT double gl_width(const char *);
67 FL_EXPORT double gl_width(const char *, int n);
68 FL_EXPORT double gl_width(uchar);
69
70 FL_EXPORT void gl_draw(const char*);
71 FL_EXPORT void gl_draw(const char*, int n);
72 FL_EXPORT void gl_draw(const char*, int x, int y);
73 FL_EXPORT void gl_draw(const char*, float x, float y);
74 FL_EXPORT void gl_draw(const char*, int n, int x, int y);
75 FL_EXPORT void gl_draw(const char*, int n, float x, float y);
76 FL_EXPORT void gl_draw(const char*, int x, int y, int w, int h, Fl_Align);
77 FL_EXPORT void gl_measure(const char*, int& x, int& y);
78
79 FL_EXPORT void gl_draw_image(const uchar *, int x,int y,int w,int h, int d=3, int ld=0);
80
81 #endif // !FL_gl_H
82
83 //
84 // End of "$Id: gl.h,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".
85 //