From: Andreas Hartmetz Date: Fri, 12 Jul 2013 09:50:39 +0000 (+0200) Subject: WGL: Support float-based attrib_list parameters. X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=207ced34a8b998539414c5213acc6d7a393ca27a WGL: Support float-based attrib_list parameters. Followup to making it possible in the code generator. --- diff --git a/specs/wglapi.py b/specs/wglapi.py index 9f83237..2ee25cc 100644 --- a/specs/wglapi.py +++ b/specs/wglapi.py @@ -146,8 +146,7 @@ WGLContextAttribs = AttribArray(WGLenum, [ ('WGL_CONTEXT_PROFILE_MASK_ARB', Flags(Int, ["WGL_CONTEXT_CORE_PROFILE_BIT_ARB", "WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB"])) ]) -#ignoring the float attribs because it's doubtful that anyone uses them -WGLPixelFormatARBAttribs = AttribArray(WGLenum, [ +WGLPixelFormatARBAttribsList = [ ('WGL_DRAW_TO_WINDOW_ARB', BOOL), ('WGL_DRAW_TO_BITMAP_ARB', BOOL), ('WGL_ACCELERATION_ARB', FakeEnum(Int, ['WGL_NO_ACCELERATION_ARB', 'WGL_GENERIC_ACCELERATION_ARB', 'WGL_FULL_ACCELERATION_ARB'])), @@ -178,9 +177,12 @@ WGLPixelFormatARBAttribs = AttribArray(WGLenum, [ ('WGL_DEPTH_BITS_ARB', Int), ('WGL_STENCIL_BITS_ARB', Int), ('WGL_AUX_BUFFERS_ARB', Int) -]) +] + +WGLPixelFormatARBAttribs = AttribArray(WGLenum, WGLPixelFormatARBAttribsList) +WGLPixelFormatARBFloatAttribs = AttribArray(WGLenum, WGLPixelFormatARBAttribsList, punType = FLOAT) -WGLPixelFormatEXTAttribs = AttribArray(WGLenum, [ +WGLPixelFormatEXTAttribsList = [ # ('WGL_NUMBER_PIXEL_FORMATS_EXT', Int), # not in ...ARB # only allowed in wglGetPixelFormatAttribiv ('WGL_DRAW_TO_WINDOW_ARB', BOOL), ('WGL_DRAW_TO_BITMAP_ARB', BOOL), @@ -218,7 +220,10 @@ WGLPixelFormatEXTAttribs = AttribArray(WGLenum, [ ('WGL_DEPTH_BITS_ARB', Int), ('WGL_STENCIL_BITS_ARB', Int), ('WGL_AUX_BUFFERS_ARB', Int) -]) +] + +WGLPixelFormatEXTAttribs = AttribArray(WGLenum, WGLPixelFormatEXTAttribsList) +WGLPixelFormatEXTFloatAttribs = AttribArray(WGLenum, WGLPixelFormatEXTAttribsList, punType = FLOAT) WGLCreatePbufferARBAttribs = AttribArray(WGLenum, [ ('WGL_PBUFFER_LARGEST_ARB', Int) @@ -280,7 +285,7 @@ wglapi.addFunctions([ # WGL_ARB_pixel_format StdFunction(BOOL, "wglGetPixelFormatAttribivARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False), StdFunction(BOOL, "wglGetPixelFormatAttribfvARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False), - StdFunction(BOOL, "wglChoosePixelFormatARB", [(HDC, "hdc"), (WGLPixelFormatARBAttribs, "piAttribIList"), (Array(Const(FLOAT), "_AttribPairList_size(pfAttribFList)"), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "(*nNumFormats)"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), + StdFunction(BOOL, "wglChoosePixelFormatARB", [(HDC, "hdc"), (WGLPixelFormatARBAttribs, "piAttribIList"), (WGLPixelFormatARBFloatAttribs, "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "(*nNumFormats)"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), # WGL_ARB_make_current_read StdFunction(BOOL, "wglMakeContextCurrentARB", [(HDC, "hDrawDC"), (HDC, "hReadDC"), (HGLRC, "hglrc")]), @@ -311,7 +316,7 @@ wglapi.addFunctions([ # WGL_EXT_pixel_format StdFunction(BOOL, "wglGetPixelFormatAttribivEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False), StdFunction(BOOL, "wglGetPixelFormatAttribfvEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(WGLenum, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False), - StdFunction(BOOL, "wglChoosePixelFormatEXT", [(HDC, "hdc"), (WGLPixelFormatEXTAttribs, "piAttribIList"), (Array(Const(FLOAT), "_AttribPairList_size(pfAttribFList)"), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "*nNumFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), + StdFunction(BOOL, "wglChoosePixelFormatEXT", [(HDC, "hdc"), (WGLPixelFormatEXTAttribs, "piAttribIList"), (WGLPixelFormatEXTFloatAttribs, "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "*nNumFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), # WGL_EXT_swap_control StdFunction(BOOL, "wglSwapIntervalEXT", [(Int, "interval")]),