FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Gl_Choice.H
1//
2// OpenGL definitions for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2018 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17// Internal interface to set up OpenGL.
18//
19// A "Fl_Gl_Choice" is created from an OpenGL mode and holds information
20// necessary to create a window (on X) and to create an OpenGL "context"
21// (on both X and Win32).
22//
23// create_gl_context takes a window (necessary only on Win32) and an
24// Fl_Gl_Choice and returns a new OpenGL context. All contexts share
25// display lists with each other.
26//
27// On X another create_gl_context is provided to create it for any
28// X visual.
29//
30// set_gl_context makes the given OpenGL context current and makes
31// it draw into the passed window. It tracks the current one context
32// to avoid calling the context switching code when the same context
33// is used, though it is a mystery to me why the GLX/WGL libraries
34// don't do this themselves...
35//
36// delete_gl_context destroys the context.
37//
38// This code is used by Fl_Gl_Window, gl_start(), and gl_visual()
39
40#ifndef Fl_Gl_Choice_H
41#define Fl_Gl_Choice_H
42
43// Describes the platform-independent part of data needed to create a GLContext.
44 class Fl_Gl_Choice {
45 friend class Fl_Gl_Window_Driver;
46 int mode;
47 const int *alist;
48 Fl_Gl_Choice *next;
49 public:
50 Fl_Gl_Choice(int m, const int *alistp, Fl_Gl_Choice *n) : mode(m), alist(alistp), next(n) {}
51};
52
53#endif // Fl_Gl_Choice_H