Panda3D
|
00001 // Filename: tinyOsxGraphicsPipe.h 00002 // Created by: drose (12May08) 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 TINYOSXGRAPHICSPIPE_H 00016 #define TINYOSXGRAPHICSPIPE_H 00017 00018 #include "pandabase.h" 00019 00020 #if defined(IS_OSX) && !defined(BUILD_IPHONE) 00021 00022 // We have to include this early, before anyone includes 00023 // netinet/tcp.h, which will define TCP_NODELAY and other symbols and 00024 // confuse the Apple system headers. 00025 #include <Carbon/Carbon.h> 00026 00027 #include "graphicsPipe.h" 00028 #include "tinyGraphicsStateGuardian.h" 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Class : TinyOsxGraphicsPipe 00032 // Description : This graphics pipe represents the interface for 00033 // creating TinyPanda graphics windows on a Mac client. 00034 //////////////////////////////////////////////////////////////////// 00035 class EXPCL_TINYDISPLAY TinyOsxGraphicsPipe : public GraphicsPipe { 00036 public: 00037 TinyOsxGraphicsPipe(); 00038 virtual ~TinyOsxGraphicsPipe(); 00039 00040 virtual string get_interface_name() const; 00041 static PT(GraphicsPipe) pipe_constructor(); 00042 00043 static CGImageRef create_cg_image(const PNMImage &pnm_image); 00044 00045 private: 00046 static void release_data(void *info, const void *data, size_t size); 00047 00048 protected: 00049 virtual PT(GraphicsOutput) make_output(const string &name, 00050 const FrameBufferProperties &fb_prop, 00051 const WindowProperties &win_prop, 00052 int flags, 00053 GraphicsEngine *engine, 00054 GraphicsStateGuardian *gsg, 00055 GraphicsOutput *host, 00056 int retry, 00057 bool &precertify); 00058 00059 public: 00060 static TypeHandle get_class_type() { 00061 return _type_handle; 00062 } 00063 static void init_type() { 00064 GraphicsPipe::init_type(); 00065 register_type(_type_handle, "TinyOsxGraphicsPipe", 00066 GraphicsPipe::get_class_type()); 00067 } 00068 virtual TypeHandle get_type() const { 00069 return get_class_type(); 00070 } 00071 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00072 00073 private: 00074 static TypeHandle _type_handle; 00075 }; 00076 00077 #include "tinyOsxGraphicsPipe.I" 00078 00079 #endif // IS_OSX 00080 00081 #endif