00001
00002
00003
00004
00005
00006
00007
00008
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
00025
00026
00027
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 virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine);
00054
00055 public:
00056 static TypeHandle get_class_type() {
00057 return _type_handle;
00058 }
00059 static void init_type() {
00060 GraphicsPipe::init_type();
00061 register_type(_type_handle, "osxGraphicsPipe",
00062 GraphicsPipe::get_class_type());
00063 }
00064 virtual TypeHandle get_type() const {
00065 return get_class_type();
00066 }
00067 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00068
00069 private:
00070 static TypeHandle _type_handle;
00071
00072 friend class osxGraphicsBuffer;
00073 };
00074
00075 #endif