FLTK 1.3.9: gl.h Source File

FLTK 1.3.9

Loading...
Searching...
No Matches
gl.h
Go to the documentation of this file.
1//
2// "$Id$"
3//
4// OpenGL header file for the Fast Light Tool Kit (FLTK).
5//
6// Copyright 1998-2011 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. Distribution and use rights are outlined in
16// the file "COPYING" which should have been included with this file. If this
17// file is missing or damaged, see the license at:
18//
19// http://www.fltk.org/COPYING.php
20//
21// Please report all bugs and problems on the following page:
22//
23// http://www.fltk.org/str.php
24//
25
42#ifndef FL_gl_H
43# define FL_gl_H
44
45# include "Enumerations.H" // for color names
46# ifdef WIN32
47# include <windows.h>
48# endif
49# ifndef APIENTRY
50# if defined(__CYGWIN__)
51# define APIENTRY __attribute__ ((__stdcall__))
52# else
53# define APIENTRY
54# endif
55# endif
56
57# ifdef __APPLE__
58# include <OpenGL/gl.h>
59# else
60# include <GL/gl.h>
61# endif // __APPLE__
62
63FL_EXPORT void gl_start();
64FL_EXPORT void gl_finish();
65
66FL_EXPORT void gl_color(Fl_Color i);
68 inline void gl_color(int c) {gl_color((Fl_Color)c);}
69
70FL_EXPORT void gl_rect(int x,int y,int w,int h);
75 inline void gl_rectf(int x,int y,int w,int h) {glRecti(x,y,x+w,y+h);}
76
77FL_EXPORT void gl_font(int fontid, int size);
78FL_EXPORT int gl_height();
79FL_EXPORT int gl_descent();
80FL_EXPORT double gl_width(const char *);
81FL_EXPORT double gl_width(const char *, int n);
82FL_EXPORT double gl_width(uchar);
83
84FL_EXPORT void gl_draw(const char*);
85FL_EXPORT void gl_draw(const char*, int n);
86FL_EXPORT void gl_draw(const char*, int x, int y);
87FL_EXPORT void gl_draw(const char*, float x, float y);
88FL_EXPORT void gl_draw(const char*, int n, int x, int y);
89FL_EXPORT void gl_draw(const char*, int n, float x, float y);
90FL_EXPORT void gl_draw(const char*, int x, int y, int w, int h, Fl_Align);
91FL_EXPORT void gl_measure(const char*, int& x, int& y);
92#ifdef __APPLE__
93extern FL_EXPORT void gl_texture_pile_height(int max);
94extern FL_EXPORT int gl_texture_pile_height();
95#endif
96
97FL_EXPORT void gl_draw_image(const uchar *, int x,int y,int w,int h, int d=3, int ld=0);
98
99#endif // !FL_gl_H
100
101//
102// End of "$Id$".
103//
Enumerations.H
This file contains type definitions and general enumerations.
Fl_Align
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:826
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition: Enumerations.H:932
uchar
unsigned char uchar
unsigned char
Definition: fl_types.h:30
gl_measure
FL_EXPORT void gl_measure(const char *, int &x, int &y)
Measure how wide and tall the string will be when drawn by the gl_draw() function.
Definition: gl_draw.cxx:279
gl_width
FL_EXPORT double gl_width(const char *)
Returns the width of the string in the current fnt.
Definition: gl_draw.cxx:58
gl_color
FL_EXPORT void gl_color(Fl_Color i)
Sets the curent OpenGL color to an FLTK color.
Definition: gl_draw.cxx:311
gl_rectf
void gl_rectf(int x, int y, int w, int h)
Fills the given rectangle with the current color.
Definition: gl.h:75
gl_rect
FL_EXPORT void gl_rect(int x, int y, int w, int h)
Outlines the given rectangle with the current color.
Definition: gl_draw.cxx:288
gl_draw
FL_EXPORT void gl_draw(const char *)
Draws a nul-terminated string in the current font at the current position.
Definition: gl_draw.cxx:241
gl_start
FL_EXPORT void gl_start()
Creates an OpenGL context.
Definition: gl_start.cxx:56
gl_finish
FL_EXPORT void gl_finish()
Releases an OpenGL context.
Definition: gl_start.cxx:98
gl_descent
FL_EXPORT int gl_descent()
Returns the current font's descent.
Definition: gl_draw.cxx:56
gl_height
FL_EXPORT int gl_height()
Returns the current font's height.
Definition: gl_draw.cxx:54
gl_font
FL_EXPORT void gl_font(int fontid, int size)
Sets the current OpenGL font to the same font as calling fl_font()
Definition: gl_draw.cxx:78
gl_texture_pile_height
int gl_texture_pile_height(void)
Returns the current height of the pile of pre-computed string textures.
Definition: gl_draw.cxx:560