Panda3D
|
00001 //////////////////////////////////////////////////////////////////// 00002 // 00003 // PANDA 3D SOFTWARE 00004 // Copyright (c) Carnegie Mellon University. All rights reserved. 00005 // 00006 // All use of this software is subject to the terms of the revised BSD 00007 // license. You should have received a copy of this license along 00008 // with this source code in a file named "LICENSE." 00009 // 00010 //////////////////////////////////////////////////////////////////// 00011 00012 #ifndef OSXGRAPHICSPIPE_H 00013 #define OSXGRAPHICSPIPE_H 00014 00015 #include "pandabase.h" 00016 #include "graphicsPipe.h" 00017 00018 #include <Carbon/Carbon.h> 00019 00020 class osxGraphicsStateGuardian; 00021 class PNMImage; 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Class : osxGraphicsPipe 00025 // Description : This graphics pipe represents the interface for 00026 // creating OpenGL graphics windows on the various 00027 // OSX's. 00028 //////////////////////////////////////////////////////////////////// 00029 class EXPCL_PANDAGL osxGraphicsPipe : public GraphicsPipe { 00030 public: 00031 osxGraphicsPipe(); 00032 virtual ~osxGraphicsPipe(); 00033 00034 virtual string get_interface_name() const; 00035 static PT(GraphicsPipe) pipe_constructor(); 00036 virtual PreferredWindowThread get_preferred_window_thread() const; 00037 00038 static CGImageRef create_cg_image(const PNMImage &pnm_image); 00039 00040 private: 00041 static void release_data(void *info, const void *data, size_t size); 00042 00043 protected: 00044 virtual PT(GraphicsOutput) make_output(const string &name, 00045 const FrameBufferProperties &fb_prop, 00046 const WindowProperties &win_prop, 00047 int flags, 00048 GraphicsEngine *engine, 00049 GraphicsStateGuardian *gsg, 00050 GraphicsOutput *host, 00051 int retry, 00052 bool &precertify); 00053 00054 public: 00055 static TypeHandle get_class_type() { 00056 return _type_handle; 00057 } 00058 static void init_type() { 00059 GraphicsPipe::init_type(); 00060 register_type(_type_handle, "osxGraphicsPipe", 00061 GraphicsPipe::get_class_type()); 00062 } 00063 virtual TypeHandle get_type() const { 00064 return get_class_type(); 00065 } 00066 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00067 00068 private: 00069 static TypeHandle _type_handle; 00070 00071 friend class osxGraphicsBuffer; 00072 }; 00073 00074 #endif