Panda3D
|
00001 // Filename: iPhoneGraphicsStateGuardian.h 00002 // Created by: drose (08Apr09) 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 #ifndef IPHONEGRAPHICSSTATEGUARDIAN_H 00016 #define IPHONEGRAPHICSSTATEGUARDIAN_H 00017 00018 #include "pandabase.h" 00019 #include "glesgsg.h" 00020 00021 #include "iPhoneGraphicsWindow.h" 00022 00023 class IPhoneGraphicsWindow; 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : IPhoneGraphicsStateGuardian 00027 // Description : 00028 //////////////////////////////////////////////////////////////////// 00029 class IPhoneGraphicsStateGuardian : public GLESGraphicsStateGuardian { 00030 public: 00031 IPhoneGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, 00032 IPhoneGraphicsStateGuardian *share_with); 00033 virtual ~IPhoneGraphicsStateGuardian(); 00034 virtual void reset(); 00035 00036 protected: 00037 virtual void *get_extension_func(const char *prefix, const char *name); 00038 00039 private: 00040 void describe_pixel_format(FrameBufferProperties &fb_props); 00041 00042 // We have to save a pointer to the GSG we intend to share texture 00043 // context with, since we don't create our own context in the 00044 // constructor. 00045 PT(IPhoneGraphicsStateGuardian) _share_with; 00046 00047 public: 00048 GLint _shared_buffer; 00049 00050 public: 00051 static TypeHandle get_class_type() { 00052 return _type_handle; 00053 } 00054 static void init_type() { 00055 GLESGraphicsStateGuardian::init_type(); 00056 register_type(_type_handle, "IPhoneGraphicsStateGuardian", 00057 GLESGraphicsStateGuardian::get_class_type()); 00058 } 00059 virtual TypeHandle get_type() const { 00060 return get_class_type(); 00061 } 00062 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00063 00064 private: 00065 static TypeHandle _type_handle; 00066 00067 friend class IPhoneGraphicsBuffer; 00068 }; 00069 00070 00071 #endif