Panda3D
|
00001 // Filename: eaglView.h 00002 // Created by: drose (10Apr09) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "pandabase.h" 00016 #import <UIKit/UIKit.h> 00017 #import <OpenGLES/EAGL.h> 00018 #import <OpenGLES/ES1/gl.h> 00019 #import <OpenGLES/ES1/glext.h> 00020 00021 class IPhoneGraphicsWindow; 00022 00023 /* 00024 This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 00025 The view content is basically an EAGL surface you render your OpenGL scene into. 00026 Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 00027 */ 00028 @interface EAGLView : UIView { 00029 00030 @public 00031 IPhoneGraphicsWindow *_window; 00032 @private 00033 00034 /* The pixel dimensions of the backbuffer */ 00035 GLint backingWidth; 00036 GLint backingHeight; 00037 00038 EAGLContext *context; 00039 00040 /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 00041 GLuint viewRenderbuffer, viewFramebuffer; 00042 00043 /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 00044 GLuint depthRenderbuffer; 00045 } 00046 00047 - (void)presentView; 00048 00049 @end