15 #ifndef WGLGRAPHICSSTATEGUARDIAN_H
16 #define WGLGRAPHICSSTATEGUARDIAN_H
18 #include "pandabase.h"
60 virtual void get_extra_extensions();
61 virtual void *do_get_extension_func(
const char *name);
64 void make_context(HDC hdc);
65 HGLRC get_share_context()
const;
70 void release_twindow();
72 static void register_twindow_class();
81 bool _pfnum_supports_pbuffer;
95 static const char *
const _twindow_class_name;
96 static bool _twindow_class_registered;
99 bool _supports_swap_control;
100 PFNWGLSWAPINTERVALEXTPROC _wglSwapIntervalEXT;
102 bool _supports_pbuffer;
103 PFNWGLCREATEPBUFFERARBPROC _wglCreatePbufferARB;
104 PFNWGLGETPBUFFERDCARBPROC _wglGetPbufferDCARB;
105 PFNWGLRELEASEPBUFFERDCARBPROC _wglReleasePbufferDCARB;
106 PFNWGLDESTROYPBUFFERARBPROC _wglDestroyPbufferARB;
107 PFNWGLQUERYPBUFFERARBPROC _wglQueryPbufferARB;
109 bool _supports_pixel_format;
110 PFNWGLGETPIXELFORMATATTRIBIVARBPROC _wglGetPixelFormatAttribivARB;
111 PFNWGLGETPIXELFORMATATTRIBFVARBPROC _wglGetPixelFormatAttribfvARB;
112 PFNWGLCHOOSEPIXELFORMATARBPROC _wglChoosePixelFormatARB;
114 bool _supports_wgl_multisample;
116 bool _supports_wgl_render_texture;
117 PFNWGLBINDTEXIMAGEARBPROC _wglBindTexImageARB;
118 PFNWGLRELEASETEXIMAGEARBPROC _wglReleaseTexImageARB;
119 PFNWGLSETPBUFFERATTRIBARBPROC _wglSetPbufferAttribARB;
125 static void init_type() {
126 GLGraphicsStateGuardian::init_type();
127 register_type(_type_handle,
"wglGraphicsStateGuardian",
128 GLGraphicsStateGuardian::get_class_type());
131 return get_class_type();
133 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
141 #include "wglGraphicsStateGuardian.I"
HDC get_twindow_dc()
Returns the DC associated with the temporary, invisible window that was created with the gsg to query...
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.
bool pfnum_supports_pbuffer() const
Returns true if the gsg's pixel format is capable of supporting a pbuffer.
bool get_supports_wgl_render_texture() const
Returns true if this particular GSG can render from a wglGraphicsBuffer directly into a texture...
const FrameBufferProperties & get_fb_properties() const
Returns the properties of the pixel format that was chosen for this gsg.
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.
int get_pfnum() const
Returns the pixel format number chosen for windows that use this context.
bool made_context() const
Returns true if the GSG has had a context made for it already, false otherwise.
virtual void reset()
Resets all internal state as if the gsg were newly created.
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.
An offscreen render buffer.
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...