365cfba4e9758a0905ce8aa5359c4ea6551220c7
[xscreensaver] / OSX / XScreenSaverGLView.h
1 /* xscreensaver, Copyright (c) 2006-2012 Jamie Zawinski <jwz@jwz.org>
2 *
3 * Permission to use, copy, modify, distribute, and sell this software and its
4 * documentation for any purpose is hereby granted without fee, provided that
5 * the above copyright notice appear in all copies and that both that
6 * copyright notice and this permission notice appear in supporting
7 * documentation.  No representations are made about the suitability of this
8 * software for any purpose.  It is provided "as is" without express or 
9 * implied warranty.
10 */
11
12 /* This is a subclass of Apple's ScreenSaverView that knows how to run
13    xscreensaver programs without X11 via the dark magic of the "jwxyz"
14    library.  In xscreensaver terminology, this is the replacement for
15    the "screenhack.c" module.
16  */
17
18 #import "XScreenSaverView.h"
19
20 #ifdef USE_IPHONE
21 # import <OpenGLES/EAGL.h>
22 # import <OpenGLES/ES1/gl.h>
23 # import <OpenGLES/ES1/glext.h>
24 # import <QuartzCore/QuartzCore.h>
25 # define NSOpenGLContext EAGLContext
26 #else
27 # import <AppKit/NSOpenGL.h>
28 #endif
29
30 @interface XScreenSaverGLView : XScreenSaverView
31 {
32   NSOpenGLContext *ogl_ctx;      // OpenGL rendering context
33
34 # ifdef USE_IPHONE
35   GLuint gl_framebuffer, gl_renderbuffer, gl_depthbuffer;
36 # endif /* USE_IPHONE */
37 }
38
39 @end