Panda3D
wglGraphicsPipe.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 wglGraphicsPipe.h
10  * @author drose
11  * @date 2002-12-20
12  */
13 
14 #ifndef WGLGRAPHICSPIPE_H
15 #define WGLGRAPHICSPIPE_H
16 
17 #include "pandabase.h"
18 #include "winGraphicsPipe.h"
19 
21 
22 /**
23  * This graphics pipe represents the interface for creating OpenGL graphics
24  * windows on the various Windows OSes.
25  */
26 class EXPCL_PANDA_WGLDISPLAY wglGraphicsPipe : public WinGraphicsPipe {
27 public:
29  virtual ~wglGraphicsPipe();
30 
31  virtual std::string get_interface_name() const;
32  static PT(GraphicsPipe) pipe_constructor();
33 
34 protected:
35  virtual PT(GraphicsOutput) make_output(const std::string &name,
36  const FrameBufferProperties &fb_prop,
37  const WindowProperties &win_prop,
38  int flags,
39  GraphicsEngine *engine,
41  GraphicsOutput *host,
42  int retry,
43  bool &precertify);
44  virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine);
45 
46 private:
47 
48  static std::string format_pfd_flags(DWORD pfd_flags);
49  static bool wgl_make_current(HDC hdc, HGLRC hglrc, PStatCollector *collector);
50 
51  static bool _current_valid;
52  static HDC _current_hdc;
53  static HGLRC _current_hglrc;
54  static Thread *_current_thread;
55 
56 public:
57  static TypeHandle get_class_type() {
58  return _type_handle;
59  }
60  static void init_type() {
61  WinGraphicsPipe::init_type();
62  register_type(_type_handle, "wglGraphicsPipe",
63  WinGraphicsPipe::get_class_type());
64  }
65  virtual TypeHandle get_type() const {
66  return get_class_type();
67  }
68  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
69 
70 private:
71  static TypeHandle _type_handle;
72 
73  friend class wglGraphicsBuffer;
74  friend class wglGraphicsWindow;
75  friend class wglGraphicsStateGuardian;
76 };
77 
78 #include "wglGraphicsPipe.I"
79 
80 #endif
wglGraphicsPipe.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
FrameBufferProperties
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
Definition: frameBufferProperties.h:26
wglGraphicsBuffer
An offscreen render buffer.
Definition: wglGraphicsBuffer.h:35
winGraphicsPipe.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
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
WindowProperties
A container for the various kinds of properties we might ask to have on a graphics window before we o...
Definition: windowProperties.h:29
wglGraphicsWindow
A single graphics window for rendering OpenGL under Microsoft Windows.
Definition: wglGraphicsWindow.h:23
GraphicsEngine
This class is the main interface to controlling the render process.
Definition: graphicsEngine.h:53
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
GraphicsOutput
This is a base class for the various different classes that represent the result of a frame of render...
Definition: graphicsOutput.h:63
wglGraphicsPipe
This graphics pipe represents the interface for creating OpenGL graphics windows on the various Windo...
Definition: wglGraphicsPipe.h:26
PStatCollector
A lightweight class that represents a single element that may be timed and/or counted via stats.
Definition: pStatCollector.h:43
GraphicsPipe
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:52
wglGraphicsStateGuardian
A tiny specialization on GLGraphicsStateGuardian to add some wgl-specific information.
Definition: wglGraphicsStateGuardian.h:28
WinGraphicsPipe
This is an abstract base class for wglGraphicsPipe and wdxGraphicsPipe; that is, those graphics pipes...
Definition: winGraphicsPipe.h:30
GraphicsStateGuardian
Encapsulates all the communication with a particular instance of a given rendering backend.
Definition: graphicsStateGuardian.h:65
Thread
A thread; that is, a lightweight process.
Definition: thread.h:46