14 #ifndef WGLGRAPHICSSTATEGUARDIAN_H 15 #define WGLGRAPHICSSTATEGUARDIAN_H 57 virtual void get_extra_extensions();
58 virtual void *do_get_extension_func(
const char *name);
61 void make_context(HDC hdc);
62 HGLRC get_share_context()
const;
67 void release_twindow();
69 static void register_twindow_class();
77 bool _pfnum_supports_pbuffer;
91 static const char *
const _twindow_class_name;
92 static bool _twindow_class_registered;
95 bool _supports_swap_control;
96 PFNWGLSWAPINTERVALEXTPROC _wglSwapIntervalEXT;
98 bool _supports_pbuffer;
99 PFNWGLCREATEPBUFFERARBPROC _wglCreatePbufferARB;
100 PFNWGLGETPBUFFERDCARBPROC _wglGetPbufferDCARB;
101 PFNWGLRELEASEPBUFFERDCARBPROC _wglReleasePbufferDCARB;
102 PFNWGLDESTROYPBUFFERARBPROC _wglDestroyPbufferARB;
103 PFNWGLQUERYPBUFFERARBPROC _wglQueryPbufferARB;
105 bool _supports_pixel_format;
106 PFNWGLGETPIXELFORMATATTRIBIVARBPROC _wglGetPixelFormatAttribivARB;
107 PFNWGLGETPIXELFORMATATTRIBFVARBPROC _wglGetPixelFormatAttribfvARB;
108 PFNWGLCHOOSEPIXELFORMATARBPROC _wglChoosePixelFormatARB;
110 bool _supports_wgl_multisample;
112 bool _supports_wgl_render_texture;
113 PFNWGLBINDTEXIMAGEARBPROC _wglBindTexImageARB;
114 PFNWGLRELEASETEXIMAGEARBPROC _wglReleaseTexImageARB;
115 PFNWGLSETPBUFFERATTRIBARBPROC _wglSetPbufferAttribARB;
117 PFNWGLCREATECONTEXTATTRIBSARBPROC _wglCreateContextAttribsARB;
123 static void init_type() {
124 GLGraphicsStateGuardian::init_type();
126 GLGraphicsStateGuardian::get_class_type());
129 return get_class_type();
131 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
HDC get_twindow_dc()
Returns the DC associated with the temporary, invisible window that was created with the gsg to query...
int get_pfnum() const
Returns the pixel format number chosen for windows that use this context.
bool set_gamma(PN_stdfloat gamma)
Non static version of setting gamma.
static bool get_gamma_table(void)
Static function for getting the original gamma.
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.
bool made_context() const
Returns true if the GSG has had a context made for it already, false otherwise.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void restore_gamma()
Restore original gamma.
static bool static_set_gamma(bool restore, PN_stdfloat gamma)
Static function for setting gamma which is needed for atexit.
bool get_properties_advanced(FrameBufferProperties &properties, HDC hdc, int pfnum)
Gets the FrameBufferProperties to match the indicated pixel format descriptor, using the WGL extensio...
bool fail_pfnum()
This is called by wglGraphicsWindow when it finds it cannot use the pfnum determined by the GSG.
A tiny specialization on GLGraphicsStateGuardian to add some wgl-specific information.
virtual void reset()
Resets all internal state as if the gsg were newly created.
bool get_supports_wgl_render_texture() const
Returns true if this particular GSG can render from a wglGraphicsBuffer directly into a texture,...
HGLRC get_context(HDC hdc)
Returns the GL context associated with the GSG.
static void atexit_function(void)
This function is passed to the atexit function.
void choose_pixel_format(const FrameBufferProperties &properties, bool need_pbuffer)
Selects a pixel format for all the windows and buffers that use this gsg.
An object to create GraphicsOutputs that share a particular 3-D API.
void get_properties(FrameBufferProperties &properties, HDC hdc, int pfnum)
Gets the FrameBufferProperties to match the indicated pixel format descriptor.
const FrameBufferProperties & get_fb_properties() const
Returns the properties of the pixel format that was chosen for this gsg.
An offscreen render buffer.
bool pfnum_supports_pbuffer() const
Returns true if the gsg's pixel format is capable of supporting a pbuffer.
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...