Panda3D
tinyOsxGraphicsPipe.h
1 // Filename: tinyOsxGraphicsPipe.h
2 // Created by: drose (12May08)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef TINYOSXGRAPHICSPIPE_H
16 #define TINYOSXGRAPHICSPIPE_H
17 
18 #include "pandabase.h"
19 
20 #if defined(IS_OSX) && !defined(BUILD_IPHONE) && defined(HAVE_CARBON) && !__LP64__
21 
22 // We have to include this early, before anyone includes
23 // netinet/tcp.h, which will define TCP_NODELAY and other symbols and
24 // confuse the Apple system headers.
25 #include <Carbon/Carbon.h>
26 
27 #include "graphicsPipe.h"
28 #include "tinyGraphicsStateGuardian.h"
29 
30 ////////////////////////////////////////////////////////////////////
31 // Class : TinyOsxGraphicsPipe
32 // Description : This graphics pipe represents the interface for
33 // creating TinyPanda graphics windows on a Mac client.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_TINYDISPLAY TinyOsxGraphicsPipe : public GraphicsPipe {
36 public:
37  TinyOsxGraphicsPipe();
38  virtual ~TinyOsxGraphicsPipe();
39 
40  virtual string get_interface_name() const;
41  static PT(GraphicsPipe) pipe_constructor();
42 
43  static CGImageRef create_cg_image(const PNMImage &pnm_image);
44 
45 private:
46  static void release_data(void *info, const void *data, size_t size);
47 
48 protected:
49  virtual PT(GraphicsOutput) make_output(const string &name,
50  const FrameBufferProperties &fb_prop,
51  const WindowProperties &win_prop,
52  int flags,
53  GraphicsEngine *engine,
55  GraphicsOutput *host,
56  int retry,
57  bool &precertify);
58 
59 public:
60  static TypeHandle get_class_type() {
61  return _type_handle;
62  }
63  static void init_type() {
64  GraphicsPipe::init_type();
65  register_type(_type_handle, "TinyOsxGraphicsPipe",
66  GraphicsPipe::get_class_type());
67  }
68  virtual TypeHandle get_type() const {
69  return get_class_type();
70  }
71  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
72 
73 private:
74  static TypeHandle _type_handle;
75 };
76 
77 #include "tinyOsxGraphicsPipe.I"
78 
79 #endif // IS_OSX
80 
81 #endif
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
Definition: pnmImage.h:68
A container for the various kinds of properties we might ask to have on a graphics window before we o...
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:58
This is a base class for the various different classes that represent the result of a frame of render...
Encapsulates all the communication with a particular instance of a given rendering backend...
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...