summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c')
-rw-r--r--lib/mesa/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c87
1 files changed, 14 insertions, 73 deletions
diff --git a/lib/mesa/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c b/lib/mesa/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
index 02ccb76e2..0bd60c064 100644
--- a/lib/mesa/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
+++ b/lib/mesa/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
@@ -35,8 +35,6 @@
#include "pipe/p_defines.h"
#include "pipe/p_screen.h"
-#include "util/u_debug.h"
-
#include "stw_device.h"
#include "stw_pixelformat.h"
#include "stw_framebuffer.h"
@@ -86,9 +84,6 @@ wglCreatePbufferARB(HDC hCurrentDC,
int iDisplayablePixelFormat;
PIXELFORMATDESCRIPTOR pfd;
BOOL bRet;
- int textureFormat = WGL_NO_TEXTURE_ARB;
- int textureTarget = WGL_NO_TEXTURE_ARB;
- BOOL textureMipmap = FALSE;
info = stw_pixelformat_get_info(iPixelFormat - 1);
if (!info) {
@@ -101,47 +96,15 @@ wglCreatePbufferARB(HDC hCurrentDC,
return 0;
}
- if (piAttribList) {
- for (piAttrib = piAttribList; *piAttrib; piAttrib++) {
- switch (*piAttrib) {
- case WGL_PBUFFER_LARGEST_ARB:
- piAttrib++;
- useLargest = *piAttrib;
- break;
- case WGL_TEXTURE_FORMAT_ARB:
- /* WGL_ARB_render_texture */
- piAttrib++;
- textureFormat = *piAttrib;
- if (textureFormat != WGL_TEXTURE_RGB_ARB &&
- textureFormat != WGL_TEXTURE_RGBA_ARB &&
- textureFormat != WGL_NO_TEXTURE_ARB) {
- SetLastError(ERROR_INVALID_DATA);
- return 0;
- }
- break;
- case WGL_TEXTURE_TARGET_ARB:
- /* WGL_ARB_render_texture */
- piAttrib++;
- textureTarget = *piAttrib;
- if (textureTarget != WGL_TEXTURE_CUBE_MAP_ARB &&
- textureTarget != WGL_TEXTURE_1D_ARB &&
- textureTarget != WGL_TEXTURE_2D_ARB &&
- textureTarget != WGL_NO_TEXTURE_ARB) {
- SetLastError(ERROR_INVALID_DATA);
- return 0;
- }
- break;
- case WGL_MIPMAP_TEXTURE_ARB:
- /* WGL_ARB_render_texture */
- piAttrib++;
- textureMipmap = !!*piAttrib;
- break;
- default:
- SetLastError(ERROR_INVALID_DATA);
- debug_printf("wgl: Unsupported attribute 0x%x in %s\n",
- *piAttrib, __func__);
- return 0;
- }
+ for (piAttrib = piAttribList; *piAttrib; piAttrib++) {
+ switch (*piAttrib) {
+ case WGL_PBUFFER_LARGEST_ARB:
+ piAttrib++;
+ useLargest = *piAttrib;
+ break;
+ default:
+ SetLastError(ERROR_INVALID_DATA);
+ return 0;
}
}
@@ -255,15 +218,9 @@ wglCreatePbufferARB(HDC hCurrentDC,
}
fb->bPbuffer = TRUE;
-
- /* WGL_ARB_render_texture fields */
- fb->textureTarget = textureTarget;
- fb->textureFormat = textureFormat;
- fb->textureMipmap = textureMipmap;
-
iDisplayablePixelFormat = fb->iDisplayablePixelFormat;
- stw_framebuffer_unlock(fb);
+ stw_framebuffer_release(fb);
/*
* We need to set a displayable pixel format on the hidden window DC
@@ -287,7 +244,7 @@ wglGetPbufferDCARB(HPBUFFERARB hPbuffer)
return NULL;
}
- fb = stw_framebuffer_from_HPBUFFERARB(hPbuffer);
+ fb = (struct stw_framebuffer *)hPbuffer;
hDC = GetDC(fb->hWnd);
@@ -306,7 +263,7 @@ wglReleasePbufferDCARB(HPBUFFERARB hPbuffer,
return 0;
}
- fb = stw_framebuffer_from_HPBUFFERARB(hPbuffer);
+ fb = (struct stw_framebuffer *)hPbuffer;
return ReleaseDC(fb->hWnd, hDC);
}
@@ -322,7 +279,7 @@ wglDestroyPbufferARB(HPBUFFERARB hPbuffer)
return FALSE;
}
- fb = stw_framebuffer_from_HPBUFFERARB(hPbuffer);
+ fb = (struct stw_framebuffer *)hPbuffer;
/* This will destroy all our data */
return DestroyWindow(fb->hWnd);
@@ -341,7 +298,7 @@ wglQueryPbufferARB(HPBUFFERARB hPbuffer,
return FALSE;
}
- fb = stw_framebuffer_from_HPBUFFERARB(hPbuffer);
+ fb = (struct stw_framebuffer *)hPbuffer;
switch (iAttribute) {
case WGL_PBUFFER_WIDTH_ARB:
@@ -354,22 +311,6 @@ wglQueryPbufferARB(HPBUFFERARB hPbuffer,
/* We assume that no content is ever lost due to display mode change */
*piValue = FALSE;
return TRUE;
- /* WGL_ARB_render_texture */
- case WGL_TEXTURE_TARGET_ARB:
- *piValue = fb->textureTarget;
- return TRUE;
- case WGL_TEXTURE_FORMAT_ARB:
- *piValue = fb->textureFormat;
- return TRUE;
- case WGL_MIPMAP_TEXTURE_ARB:
- *piValue = fb->textureMipmap;
- return TRUE;
- case WGL_MIPMAP_LEVEL_ARB:
- *piValue = fb->textureLevel;
- return TRUE;
- case WGL_CUBE_MAP_FACE_ARB:
- *piValue = fb->textureFace + WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB;
- return TRUE;
default:
SetLastError(ERROR_INVALID_DATA);
return FALSE;