~ubuntu-branches/ubuntu/dapper/xscreensaver/dapper

« back to all changes in this revision

Viewing changes to hacks/glx/xlock-gl.c

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2005-10-11 21:00:42 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20051011210042-u7q6zslgevdxspr3
Tags: 4.21-4ubuntu17
updated pt_BR again, fixed to UTF-8 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* xlock-gl.c --- xscreensaver compatibility layer for xlockmore GL modules.
2
 
 * xscreensaver, Copyright (c) 1997, 1998, 1999 Jamie Zawinski <jwz@jwz.org>
 
2
 * xscreensaver, Copyright (c) 1997-2002 Jamie Zawinski <jwz@jwz.org>
3
3
 *
4
4
 * Permission to use, copy, modify, distribute, and sell this software and its
5
5
 * documentation for any purpose is hereby granted without fee, provided that
89
89
      }
90
90
  }
91
91
 
 
92
 
 
93
  /* jwz: the doc for glDrawBuffer says "The initial value is GL_FRONT
 
94
     for single-buffered contexts, and GL_BACK for double-buffered
 
95
     contexts."  However, I find that this is not always the case,
 
96
     at least with Mesa 3.4.2 -- sometimes the default seems to be
 
97
     GL_FRONT even when glGet(GL_DOUBLEBUFFER) is true.  So, let's
 
98
     make sure.
 
99
 
 
100
     Oh, hmm -- maybe this only happens when we are re-using the
 
101
     xscreensaver window, and the previous GL hack happened to die with
 
102
     the other buffer selected?  I'm not sure.  Anyway, this fixes it.
 
103
   */
 
104
  {
 
105
    GLboolean d = False;
 
106
    glGetBooleanv (GL_DOUBLEBUFFER, &d);
 
107
    if (d)
 
108
      glDrawBuffer (GL_BACK);
 
109
    else
 
110
      glDrawBuffer (GL_FRONT);
 
111
  }
 
112
 
 
113
 
92
114
  /* GLXContext is already a pointer type.
93
115
     Why this function returns a pointer to a pointer, I have no idea...
94
116
   */