Panda3D
Loading...
Searching...
No Matches
wglGraphicsWindow.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 wglGraphicsWindow.h
10 * @author drose
11 * @date 2002-12-20
12 */
13
14#ifndef WGLGRAPHICSWINDOW_H
15#define WGLGRAPHICSWINDOW_H
16
17#include "pandabase.h"
18#include "winGraphicsWindow.h"
19
20/**
21 * A single graphics window for rendering OpenGL under Microsoft Windows.
22 */
23class EXPCL_PANDA_WGLDISPLAY wglGraphicsWindow : public WinGraphicsWindow {
24public:
26 const std::string &name,
27 const FrameBufferProperties &fb_prop,
28 const WindowProperties &win_prop,
29 int flags,
31 GraphicsOutput *host);
32 virtual ~wglGraphicsWindow();
33
34 virtual bool begin_frame(FrameMode mode, Thread *current_thread);
35 virtual void end_frame(FrameMode mode, Thread *current_thread);
36
37 virtual void begin_flip();
38 virtual void ready_flip();
39 virtual void end_flip();
40
41protected:
42 virtual void close_window();
43 virtual bool open_window();
44
45private:
46 void setup_colormap(const PIXELFORMATDESCRIPTOR &pixelformat);
47
48#ifdef NOTIFY_DEBUG
49 static void print_pfd(PIXELFORMATDESCRIPTOR *pfd, char *msg);
50#endif
51
52 HDC _hdc;
53 HPALETTE _colormap;
54
55public:
56 static TypeHandle get_class_type() {
57 return _type_handle;
58 }
59 static void init_type() {
60 WinGraphicsWindow::init_type();
61 register_type(_type_handle, "wglGraphicsWindow",
62 WinGraphicsWindow::get_class_type());
63 }
64 virtual TypeHandle get_type() const {
65 return get_class_type();
66 }
67 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
68
69private:
70 static TypeHandle _type_handle;
71};
72
73#include "wglGraphicsWindow.I"
74
75#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...
virtual void ready_flip()
This function will be called within the draw thread after end_frame() has been called on all windows,...
virtual void end_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread after rendering is completed for a given frame.
virtual void end_flip()
This function will be called within the draw thread after begin_flip() has been called on all windows...
virtual bool begin_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread before beginning rendering for a given frame.
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 thread; that is, a lightweight process.
Definition thread.h:46
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
An abstract base class for glGraphicsWindow and dxGraphicsWindow (and, in general,...
virtual void begin_flip()
This function will be called within the draw thread after end_frame() has been called on all windows,...
A container for the various kinds of properties we might ask to have on a graphics window before we o...
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.