Panda3D
Loading...
Searching...
No Matches
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
21class 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 */
30class EXPCL_PANDA_DISPLAY GraphicsDevice : public TypedReferenceCount {
31public:
32 GraphicsDevice(GraphicsPipe *pipe);
33 GraphicsDevice(const GraphicsDevice &copy) = delete;
34 GraphicsDevice &operator = (const GraphicsDevice &copy) = delete;
35
36PUBLISHED:
37 virtual ~GraphicsDevice();
38
39 INLINE GraphicsPipe *get_pipe() const;
40
41protected:
42 GraphicsPipe *_pipe;
43
44public:
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
58private:
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 */
GraphicsPipe * get_pipe() const
Returns the GraphicsPipe that this device is associated with.
GraphicsDevice(GraphicsPipe *pipe)
Normally, the GraphicsDevice constructor holds a reference to the Graphics Pipe that it is part of.
An object to create GraphicsOutputs that share a particular 3-D API.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.