Panda3D

iPhoneGraphicsPipe.h

00001 // Filename: iPhoneGraphicsPipe.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 IPHONEGRAPHICSPIPE_H
00016 #define IPHONEGRAPHICSPIPE_H
00017 
00018 #include "pandabase.h"
00019 #include "graphicsPipe.h"
00020 #include "pset.h"
00021 #import "viewController.h"
00022 #import <UIKit/UIKit.h>
00023 
00024 class IPhoneGraphicsStateGuardian;
00025 class IPhoneGraphicsWindow;
00026 class PNMImage;
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //       Class : IPhoneGraphicsPipe
00030 // Description : This graphics pipe represents the interface for
00031 //               creating OpenGL graphics windows on the various
00032 //               IPHONE's.
00033 ////////////////////////////////////////////////////////////////////
00034 class EXPCL_MISC IPhoneGraphicsPipe : public GraphicsPipe {
00035 public:
00036   IPhoneGraphicsPipe();
00037   virtual ~IPhoneGraphicsPipe();
00038 
00039   virtual string get_interface_name() const;
00040   static PT(GraphicsPipe) pipe_constructor();
00041   virtual PreferredWindowThread get_preferred_window_thread() const;
00042 
00043   void rotate_windows();
00044 
00045 protected:
00046   virtual PT(GraphicsOutput) make_output(const string &name,
00047                                          const FrameBufferProperties &fb_prop,
00048                                          const WindowProperties &win_prop,
00049                                          int flags,
00050                                          GraphicsEngine *engine,
00051                                          GraphicsStateGuardian *gsg,
00052                                          GraphicsOutput *host,
00053                                          int retry,
00054                                          bool &precertify);
00055 
00056 public:
00057   UIWindow *_window; 
00058   ControllerDemoViewController *_view_controller;
00059 
00060   typedef pset<IPhoneGraphicsWindow *> GraphicsWindows;
00061   GraphicsWindows _graphics_windows;
00062 
00063 private:
00064   static IPhoneGraphicsPipe *_global_ptr;
00065 
00066 public:
00067   static TypeHandle get_class_type() {
00068     return _type_handle;
00069   }
00070   static void init_type() {
00071     GraphicsPipe::init_type();
00072     register_type(_type_handle, "IPhoneGraphicsPipe",
00073                   GraphicsPipe::get_class_type());
00074   }
00075   virtual TypeHandle get_type() const {
00076     return get_class_type();
00077   }
00078   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00079 
00080 private:
00081   static TypeHandle _type_handle;
00082 
00083   friend class IPhoneGraphicsBuffer;
00084 };
00085 
00086 #endif
 All Classes Functions Variables Enumerations