25 #include "glfPBuffer_WGL.hh"
26 #include <OpenGLFramework/Base/glfException.hh>
27 #include <Gui/biasgl.h>
39 BIASASSERT(hglfPBuffer_ == NULL);
45 if (!WGLEW_ARB_pbuffer) {
46 GLF_THROW_EXCEPTION(
"WGL_ARB_pbuffer extension is unsupported");
51 WGL_PBUFFER_LARGEST_ARB, 0,
54 hglfPBuffer_ = wglCreatePbufferARB(wglGetCurrentDC(), pixelFormat,
55 width, height, attribs);
56 if (hglfPBuffer_ == NULL) {
57 GLF_THROW_EXCEPTION(
"Failed to create glfPBuffer");
61 HDC hDC = wglGetPbufferDCARB(hglfPBuffer_);
63 GLF_THROW_EXCEPTION(
"Failed to get device context for pbuffer");
72 wglReleasePbufferDCARB(hglfPBuffer_, hDC_);
76 if (hglfPBuffer_ != NULL) {
77 wglDestroyPbufferARB(hglfPBuffer_);
84 BIASASSERT(hglfPBuffer_ != NULL);
86 wglQueryPbufferARB(hglfPBuffer_, WGL_PBUFFER_WIDTH_ARB, &width);
87 wglQueryPbufferARB(hglfPBuffer_, WGL_PBUFFER_HEIGHT_ARB, &height);
92 return WGL_DRAW_TO_PBUFFER_ARB;
virtual HDC CreateDeviceContext(int width, int height, int pixelFormat)
virtual int GetWglRenderTargetAttribute() const
virtual void DestroyDeviceContext()
virtual void GetSize(int &width, int &height)