FLTK 1.3.0
|
00001 // 00002 // "$Id$" 00003 // 00004 // OpenGL header file for the Fast Light Tool Kit (FLTK). 00005 // 00006 // Copyright 1998-2010 by Bill Spitzak and others. 00007 // 00008 // You must include this instead of GL/gl.h to get the Microsoft 00009 // APIENTRY stuff included (from <windows.h>) prior to the OpenGL 00010 // header files. 00011 // 00012 // This file also provides "missing" OpenGL functions, and 00013 // gl_start() and gl_finish() to allow OpenGL to be used in any window 00014 // 00015 // This library is free software; you can redistribute it and/or 00016 // modify it under the terms of the GNU Library General Public 00017 // License as published by the Free Software Foundation; either 00018 // version 2 of the License, or (at your option) any later version. 00019 // 00020 // This library is distributed in the hope that it will be useful, 00021 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00023 // Library General Public License for more details. 00024 // 00025 // You should have received a copy of the GNU Library General Public 00026 // License along with this library; if not, write to the Free Software 00027 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00028 // USA. 00029 // 00030 // Please report all bugs and problems on the following page: 00031 // 00032 // http://www.fltk.org/str.php 00033 // 00034 00051 #ifndef FL_gl_H 00052 # define FL_gl_H 00053 00054 # include "Enumerations.H" // for color names 00055 # ifdef WIN32 00056 # include <windows.h> 00057 # endif 00058 # ifndef APIENTRY 00059 # if defined(__CYGWIN__) 00060 # define APIENTRY __attribute__ ((__stdcall__)) 00061 # else 00062 # define APIENTRY 00063 # endif 00064 # endif 00065 00066 # ifdef __APPLE__ 00067 # include <OpenGL/gl.h> 00068 # else 00069 # include <GL/gl.h> 00070 # endif 00071 00072 FL_EXPORT void gl_start(); 00073 FL_EXPORT void gl_finish(); 00074 00075 FL_EXPORT void gl_color(Fl_Color i); 00077 inline void gl_color(int c) {gl_color((Fl_Color)c);} 00078 00079 FL_EXPORT void gl_rect(int x,int y,int w,int h); 00084 inline void gl_rectf(int x,int y,int w,int h) {glRecti(x,y,x+w,y+h);} 00085 00086 FL_EXPORT void gl_font(int fontid, int size); 00087 FL_EXPORT int gl_height(); 00088 FL_EXPORT int gl_descent(); 00089 FL_EXPORT double gl_width(const char *); 00090 FL_EXPORT double gl_width(const char *, int n); 00091 FL_EXPORT double gl_width(uchar); 00092 00093 FL_EXPORT void gl_draw(const char*); 00094 FL_EXPORT void gl_draw(const char*, int n); 00095 FL_EXPORT void gl_draw(const char*, int x, int y); 00096 FL_EXPORT void gl_draw(const char*, float x, float y); 00097 FL_EXPORT void gl_draw(const char*, int n, int x, int y); 00098 FL_EXPORT void gl_draw(const char*, int n, float x, float y); 00099 FL_EXPORT void gl_draw(const char*, int x, int y, int w, int h, Fl_Align); 00100 FL_EXPORT void gl_measure(const char*, int& x, int& y); 00101 #ifdef __APPLE__ 00102 extern FL_EXPORT void gl_texture_pile_height(int max); 00103 extern FL_EXPORT int gl_texture_pile_height(); 00104 #endif 00105 00106 FL_EXPORT void gl_draw_image(const uchar *, int x,int y,int w,int h, int d=3, int ld=0); 00107 00108 #endif // !FL_gl_H 00109 00110 // 00111 // End of "$Id$". 00112 //