Panda3D
Loading...
Searching...
No Matches
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 */
26class EXPCL_PANDA_WGLDISPLAY wglGraphicsPipe : public WinGraphicsPipe {
27public:
29 virtual ~wglGraphicsPipe();
30
31 virtual std::string get_interface_name() const;
32 static PT(GraphicsPipe) pipe_constructor();
33
34protected:
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
46private:
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
56public:
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
70private:
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
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
This class is the main interface to controlling the render process.
This is a base class for the various different classes that represent the result of a frame of render...
An object to create GraphicsOutputs that share a particular 3-D API.
Encapsulates all the communication with a particular instance of a given rendering backend.
A lightweight class that represents a single element that may be timed and/or counted via stats.
A thread; that is, a lightweight process.
Definition thread.h:46
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
This is an abstract base class for wglGraphicsPipe and wdxGraphicsPipe; that is, those graphics pipes...
A container for the various kinds of properties we might ask to have on a graphics window before we o...
An offscreen render buffer.
This graphics pipe represents the interface for creating OpenGL graphics windows on the various Windo...
A tiny specialization on GLGraphicsStateGuardian to add some wgl-specific information.
A single graphics window for rendering OpenGL under Microsoft Windows.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.