Panda3D
osxGraphicsPipe.h
1 ////////////////////////////////////////////////////////////////////
2 //
3 // PANDA 3D SOFTWARE
4 // Copyright (c) Carnegie Mellon University. All rights reserved.
5 //
6 // All use of this software is subject to the terms of the revised BSD
7 // license. You should have received a copy of this license along
8 // with this source code in a file named "LICENSE."
9 //
10 ////////////////////////////////////////////////////////////////////
11 
12 #ifndef OSXGRAPHICSPIPE_H
13 #define OSXGRAPHICSPIPE_H
14 
15 #include "pandabase.h"
16 #include "graphicsPipe.h"
17 
18 #include <Carbon/Carbon.h>
19 
21 class PNMImage;
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : osxGraphicsPipe
25 // Description : This graphics pipe represents the interface for
26 // creating OpenGL graphics windows on the various
27 // OSX's.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDAGL osxGraphicsPipe : public GraphicsPipe {
30 public:
32  virtual ~osxGraphicsPipe();
33 
34  virtual string get_interface_name() const;
35  static PT(GraphicsPipe) pipe_constructor();
36  virtual PreferredWindowThread get_preferred_window_thread() const;
37 
38  static CGImageRef create_cg_image(const PNMImage &pnm_image);
39 
40 private:
41  static void release_data(void *info, const void *data, size_t size);
42 
43 protected:
44  virtual PT(GraphicsOutput) make_output(const string &name,
45  const FrameBufferProperties &fb_prop,
46  const WindowProperties &win_prop,
47  int flags,
48  GraphicsEngine *engine,
50  GraphicsOutput *host,
51  int retry,
52  bool &precertify);
53  virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine);
54 
55 public:
56  static TypeHandle get_class_type() {
57  return _type_handle;
58  }
59  static void init_type() {
60  GraphicsPipe::init_type();
61  register_type(_type_handle, "osxGraphicsPipe",
62  GraphicsPipe::get_class_type());
63  }
64  virtual TypeHandle get_type() const {
65  return get_class_type();
66  }
67  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
68 
69 private:
70  static TypeHandle _type_handle;
71 
72  friend class osxGraphicsBuffer;
73 };
74 
75 #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
An offscreen buffer in the OSX environment.
This graphics pipe represents the interface for creating OpenGL graphics windows on the various OSX&#39;s...
A tiny specialization on GLGraphicsStateGuardian to add some wgl-specific information.
virtual PreferredWindowThread get_preferred_window_thread() const
Returns an indication of the thread in which this GraphicsPipe requires its window processing to be p...
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...