2002-11-16 05:00:14 +00:00
|
|
|
/* -*-ObjC-*- */
|
|
|
|
/* XGOpenGL - openGL management using glX
|
|
|
|
|
|
|
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Frederic De Jaeger
|
|
|
|
Date: Nov 2002
|
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-12-27 20:07:28 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2002-11-16 05:00:14 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-09 04:59:44 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2007-12-27 20:07:28 +00:00
|
|
|
|
2002-11-16 05:00:14 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-12-27 20:07:28 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
2002-11-16 05:00:14 +00:00
|
|
|
|
2007-12-27 20:07:28 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2002-11-16 05:00:14 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
2007-12-27 20:07:28 +00:00
|
|
|
If not, see <http://www.gnu.org/licenses/> or write to the
|
|
|
|
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
2002-11-16 05:00:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GNUstep_H_XGOpenGL
|
|
|
|
#define _GNUstep_H_XGOpenGL
|
|
|
|
|
|
|
|
#include <AppKit/NSOpenGL.h>
|
2002-11-16 19:41:16 +00:00
|
|
|
|
|
|
|
#define id _gs_avoid_id_collision
|
2003-03-24 18:15:56 +00:00
|
|
|
#define BOOL XWINDOWSBOOL
|
2002-11-16 05:00:14 +00:00
|
|
|
#include <GL/glx.h>
|
2002-11-16 19:41:16 +00:00
|
|
|
#undef id
|
2002-12-31 16:49:48 +00:00
|
|
|
#undef BOOL
|
2002-11-16 05:00:14 +00:00
|
|
|
|
|
|
|
@class NSView;
|
|
|
|
@class XGXSubWindow;
|
|
|
|
@class XGGLPixelFormat;
|
|
|
|
|
|
|
|
@interface XGGLContext : NSOpenGLContext
|
|
|
|
{
|
|
|
|
GLXContext glx_context;
|
|
|
|
GLXWindow glx_drawable;
|
|
|
|
XGXSubWindow *xsubwin;
|
|
|
|
XGGLPixelFormat *format;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface XGGLPixelFormat : NSOpenGLPixelFormat
|
|
|
|
{
|
|
|
|
@public
|
2003-07-23 03:40:47 +00:00
|
|
|
union {
|
|
|
|
GLXFBConfig *tab;
|
|
|
|
XVisualInfo *visual;
|
|
|
|
} conf;
|
2002-11-16 05:00:14 +00:00
|
|
|
int n_elem;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2003-07-23 03:40:47 +00:00
|
|
|
static inline int
|
|
|
|
GSglxMinorVersion(Display *dpy)
|
|
|
|
{
|
|
|
|
int major, minor;
|
|
|
|
Bool result;
|
|
|
|
result = glXQueryVersion (dpy, &major, &minor);
|
|
|
|
if (result == False)
|
|
|
|
return -1;
|
|
|
|
return minor;
|
|
|
|
}
|
|
|
|
|
2002-11-16 05:00:14 +00:00
|
|
|
#endif
|