Panda3D
wglGraphicsPipe.h
1 // Filename: wglGraphicsPipe.h
2 // Created by: drose (20Dec02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef WGLGRAPHICSPIPE_H
16 #define WGLGRAPHICSPIPE_H
17 
18 #include "pandabase.h"
19 #include "winGraphicsPipe.h"
20 
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : wglGraphicsPipe
25 // Description : This graphics pipe represents the interface for
26 // creating OpenGL graphics windows on the various
27 // Windows OSes.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDAGL wglGraphicsPipe : public WinGraphicsPipe {
30 public:
32  virtual ~wglGraphicsPipe();
33 
34  virtual string get_interface_name() const;
35  static PT(GraphicsPipe) pipe_constructor();
36 
37 protected:
38  virtual PT(GraphicsOutput) make_output(const string &name,
39  const FrameBufferProperties &fb_prop,
40  const WindowProperties &win_prop,
41  int flags,
42  GraphicsEngine *engine,
44  GraphicsOutput *host,
45  int retry,
46  bool &precertify);
47  virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine);
48 
49 private:
50 
51  static string format_pfd_flags(DWORD pfd_flags);
52  static void wgl_make_current(HDC hdc, HGLRC hglrc, PStatCollector *collector);
53 
54  static bool _current_valid;
55  static HDC _current_hdc;
56  static HGLRC _current_hglrc;
57 
58 public:
59  static TypeHandle get_class_type() {
60  return _type_handle;
61  }
62  static void init_type() {
63  WinGraphicsPipe::init_type();
64  register_type(_type_handle, "wglGraphicsPipe",
65  WinGraphicsPipe::get_class_type());
66  }
67  virtual TypeHandle get_type() const {
68  return get_class_type();
69  }
70  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
71 
72 private:
73  static TypeHandle _type_handle;
74 
75  friend class wglGraphicsBuffer;
76  friend class wglGraphicsWindow;
77  friend class wglGraphicsStateGuardian;
78 };
79 
80 #include "wglGraphicsPipe.I"
81 
82 #endif
A tiny specialization on GLGraphicsStateGuardian to add some wgl-specific information.
A lightweight class that represents a single element that may be timed and/or counted via stats...
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
A single graphics window for rendering OpenGL under Microsoft Windows.
This is a base class for the various different classes that represent the result of a frame of render...
This graphics pipe represents the interface for creating OpenGL graphics windows on the various Windo...
This is an abstract base class for wglGraphicsPipe and wdxGraphicsPipe; that is, those graphics pipes...
An offscreen render buffer.
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...