Skip to content

Commit

Permalink
Stereo OpenGL patch from Stuart Levy...
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2012 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Mar 25, 2002
1 parent ba2eae8 commit 98c9f2c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.0b12

- Stereo OpenGL support (patch from Stuart Levy)
- All of the convenience functions defined in fl_ask.H
now resize the widgets and dialog window as needed for
the labels and prompt.
Expand Down
7 changes: 4 additions & 3 deletions FL/Enumerations.H
@@ -1,5 +1,5 @@
//
// "$Id: Enumerations.H,v 1.18.2.14.2.19 2002/01/09 21:50:02 easysw Exp $"
// "$Id: Enumerations.H,v 1.18.2.14.2.20 2002/03/25 16:41:01 easysw Exp $"
//
// Enumerations for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -361,7 +361,8 @@ enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut)
FL_DEPTH = 16,
FL_STENCIL = 32,
FL_RGB8 = 64,
FL_MULTISAMPLE= 128
FL_MULTISAMPLE= 128,
FL_STEREO = 256
};

// damage masks
Expand All @@ -377,5 +378,5 @@ enum Fl_Damage {
#endif

//
// End of "$Id: Enumerations.H,v 1.18.2.14.2.19 2002/01/09 21:50:02 easysw Exp $".
// End of "$Id: Enumerations.H,v 1.18.2.14.2.20 2002/03/25 16:41:01 easysw Exp $".
//
6 changes: 3 additions & 3 deletions FL/glut.H
@@ -1,5 +1,5 @@
//
// "$Id: glut.H,v 1.6.2.10.2.1 2002/01/01 15:11:28 easysw Exp $"
// "$Id: glut.H,v 1.6.2.10.2.2 2002/03/25 16:41:01 easysw Exp $"
//
// GLUT emulation header file for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -106,7 +106,7 @@ FL_EXPORT void glutInitDisplayMode(unsigned int mode);
#define GLUT_DEPTH FL_DEPTH
#define GLUT_STENCIL FL_STENCIL
#define GLUT_MULTISAMPLE FL_MULTISAMPLE
// #define GLUT_STEREO 256
#define GLUT_STEREO FL_STEREO
// #define GLUT_LUMINANCE 512

FL_EXPORT void glutInitWindowPosition(int x, int y);
Expand Down Expand Up @@ -470,5 +470,5 @@ extern void APIENTRY glutSolidIcosahedron();
#endif /* __glut_h__ */

//
// End of "$Id: glut.H,v 1.6.2.10.2.1 2002/01/01 15:11:28 easysw Exp $".
// End of "$Id: glut.H,v 1.6.2.10.2.2 2002/03/25 16:41:01 easysw Exp $".
//
13 changes: 11 additions & 2 deletions src/Fl_Gl_Choice.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.8 2002/01/03 08:08:21 matthiaswm Exp $"
// "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.9 2002/03/25 16:41:01 easysw Exp $"
//
// OpenGL visual selection code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -84,6 +84,11 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
if (mode & FL_STENCIL) {
list[n++] = AGL_STENCIL_SIZE; list[n++] = 1;
}
#ifdef AGL_STEREO /* is there such a thing as AGL_STEREO? */
if (mode & FL_STEREO) {
list[n++] = AGL_STEREO;
}
#endif
list[n] = AGL_NONE;
blist = list;
}
Expand Down Expand Up @@ -129,6 +134,9 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
if (mode & FL_STENCIL) {
list[n++] = GLX_STENCIL_SIZE; list[n++] = 1;
}
if (mode & FL_STEREO) {
list[n++] = GLX_STEREO;
}
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample)
if (mode & FL_MULTISAMPLE) {
list[n++] = GLX_SAMPLES_SGIS;
Expand Down Expand Up @@ -164,6 +172,7 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int mode, const int *alist) {
if ((mode & FL_ALPHA) && !pfd.cAlphaBits) continue;
if ((mode & FL_ACCUM) && !pfd.cAccumBits) continue;
if ((!(mode & FL_DOUBLE)) != (!(pfd.dwFlags & PFD_DOUBLEBUFFER))) continue;
if ((!(mode & FL_STEREO)) != (!(pfd.dwFlags & PFD_STEREO))) continue;
if ((mode & FL_DEPTH) && !pfd.cDepthBits) continue;
if ((mode & FL_STENCIL) && !pfd.cStencilBits) continue;
// see if better than the one we have already:
Expand Down Expand Up @@ -309,5 +318,5 @@ void fl_delete_gl_context(GLContext context) {
#endif

//
// End of "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.8 2002/01/03 08:08:21 matthiaswm Exp $".
// End of "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.9 2002/03/25 16:41:01 easysw Exp $".
//

0 comments on commit 98c9f2c

Please sign in to comment.