Panda3D
osxGraphicsPipe.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file osxGraphicsPipe.h
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  * This graphics pipe represents the interface for creating OpenGL graphics
25  * windows on the various OSX's.
26  */
27 class EXPCL_PANDA_OSXDISPLAY osxGraphicsPipe : public GraphicsPipe {
28 public:
30  virtual ~osxGraphicsPipe();
31 
32  virtual std::string get_interface_name() const;
33  static PT(GraphicsPipe) pipe_constructor();
34  virtual PreferredWindowThread get_preferred_window_thread() const;
35 
36  static CGImageRef create_cg_image(const PNMImage &pnm_image);
37 
38 private:
39  static void release_data(void *info, const void *data, size_t size);
40 
41 protected:
42  virtual PT(GraphicsOutput) make_output(const std::string &name,
43  const FrameBufferProperties &fb_prop,
44  const WindowProperties &win_prop,
45  int flags,
46  GraphicsEngine *engine,
48  GraphicsOutput *host,
49  int retry,
50  bool &precertify);
51  virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine);
52 
53 public:
54  static TypeHandle get_class_type() {
55  return _type_handle;
56  }
57  static void init_type() {
58  GraphicsPipe::init_type();
59  register_type(_type_handle, "osxGraphicsPipe",
60  GraphicsPipe::get_class_type());
61  }
62  virtual TypeHandle get_type() const {
63  return get_class_type();
64  }
65  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
66 
67 private:
68  static TypeHandle _type_handle;
69 
70  friend class osxGraphicsBuffer;
71 };
72 
73 #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:58
An offscreen buffer in the OSX environment.
This graphics pipe represents the interface for creating OpenGL graphics windows on the various OSX's...
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:52
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:81
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.