Panda3D
graphicsDevice.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 graphicsDevice.h
10  * @author masad
11  * @date 2003-07-21
12  */
13 
14 #ifndef GRAPHICSDEVICE_H
15 #define GRAPHICSDEVICE_H
16 
17 #include "pandabase.h"
18 
19 #include "typedReferenceCount.h"
20 
21 class GraphicsPipe;
22 
23 /**
24  * An abstract device object that is part of Graphics Pipe. This device is
25  * set to NULL for OpenGL. But DirectX uses it to take control of multiple
26  * windows under single device or multiple devices (i.e. more than one
27  * adapters in the machine).
28  *
29  */
30 class EXPCL_PANDA_DISPLAY GraphicsDevice : public TypedReferenceCount {
31 public:
33  GraphicsDevice(const GraphicsDevice &copy) = delete;
34  GraphicsDevice &operator = (const GraphicsDevice &copy) = delete;
35 
36 PUBLISHED:
37  virtual ~GraphicsDevice();
38 
39  INLINE GraphicsPipe *get_pipe() const;
40 
41 protected:
42  GraphicsPipe *_pipe;
43 
44 public:
45  static TypeHandle get_class_type() {
46  return _type_handle;
47  }
48  static void init_type() {
49  TypedReferenceCount::init_type();
50  register_type(_type_handle, "GraphicsDevice",
51  TypedReferenceCount::get_class_type());
52  }
53  virtual TypeHandle get_type() const {
54  return get_class_type();
55  }
56  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
57 
58 private:
59  static TypeHandle _type_handle;
60 
61  friend class GraphicsPipe;
62  friend class GraphicsEngine;
63 };
64 
65 #include "graphicsDevice.I"
66 
67 #endif /* GRAPHICSDEVICE_H */
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 base class for things which need to inherit from both TypedObject and from ReferenceCount.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:52
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An abstract device object that is part of Graphics Pipe.
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