From: Andreas Hartmetz Date: Tue, 9 Jul 2013 22:12:39 +0000 (+0200) Subject: More WGL support. It's ugly and the resulting code probably doesn't compile. X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=8b095e5763690867bdc5e8ae204e0712a669b880 More WGL support. It's ugly and the resulting code probably doesn't compile. --- diff --git a/specs/wglapi.py b/specs/wglapi.py index f966df1..9f83237 100644 --- a/specs/wglapi.py +++ b/specs/wglapi.py @@ -146,6 +146,98 @@ 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, [ + ('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'])), + ('WGL_NEED_PALETTE_ARB', BOOL), + ('WGL_NEED_SYSTEM_PALETTE_ARB', BOOL), + ('WGL_SWAP_LAYER_BUFFERS_ARB', BOOL), + ('WGL_SWAP_METHOD_ARB', FakeEnum(Int, ['WGL_SWAP_EXCHANGE_ARB', 'WGL_SWAP_COPY_ARB', 'WGL_SWAP_UNDEFINED_ARB'])), + ('WGL_NUMBER_OVERLAYS_ARB', Int), + ('WGL_NUMBER_UNDERLAYS_ARB', Int), + ('WGL_SHARE_DEPTH_ARB', BOOL), + ('WGL_SHARE_STENCIL_ARB', BOOL), + ('WGL_SHARE_ACCUM_ARB', BOOL), + ('WGL_SUPPORT_GDI_ARB', BOOL), + ('WGL_SUPPORT_OPENGL_ARB', BOOL), + ('WGL_DOUBLE_BUFFER_ARB', BOOL), + ('WGL_STEREO_ARB', BOOL), + ('WGL_PIXEL_TYPE_ARB', FakeEnum(Int, ['WGL_TYPE_RGBA_ARB', 'WGL_TYPE_COLORINDEX_ARB'])), + ('WGL_COLOR_BITS_ARB', Int), + ('WGL_RED_BITS_ARB', Int), + ('WGL_GREEN_BITS_ARB', Int), + ('WGL_BLUE_BITS_ARB', Int), + ('WGL_ALPHA_BITS_ARB', Int), + ('WGL_ACCUM_BITS_ARB', Int), + ('WGL_ACCUM_RED_BITS_ARB', Int), + ('WGL_ACCUM_GREEN_BITS_ARB', Int), + ('WGL_ACCUM_BLUE_BITS_ARB', Int), + ('WGL_ACCUM_ALPHA_BITS_ARB', Int), + ('WGL_DEPTH_BITS_ARB', Int), + ('WGL_STENCIL_BITS_ARB', Int), + ('WGL_AUX_BUFFERS_ARB', Int) +]) + +WGLPixelFormatEXTAttribs = AttribArray(WGLenum, [ +# ('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), + ('WGL_ACCELERATION_ARB', FakeEnum(Int, ['WGL_NO_ACCELERATION_ARB', 'WGL_GENERIC_ACCELERATION_ARB', 'WGL_FULL_ACCELERATION_ARB'])), + ('WGL_NEED_PALETTE_ARB', BOOL), + ('WGL_NEED_SYSTEM_PALETTE_ARB', BOOL), + ('WGL_SWAP_LAYER_BUFFERS_ARB', BOOL), + ('WGL_SWAP_METHOD_ARB', FakeEnum(Int, ['WGL_SWAP_EXCHANGE_ARB', 'WGL_SWAP_COPY_ARB', 'WGL_SWAP_UNDEFINED_ARB'])), + ('WGL_NUMBER_OVERLAYS_ARB', Int), + ('WGL_NUMBER_UNDERLAYS_ARB', Int), + ('WGL_TRANSPARENT_EXT', BOOL), # not in ...ARB + ('WGL_TRANSPARENT_VALUE_EXT', Int), # not in ...ARB + ('WGL_SHARE_DEPTH_ARB', BOOL), + ('WGL_SHARE_STENCIL_ARB', BOOL), + ('WGL_SHARE_ACCUM_ARB', BOOL), + ('WGL_SUPPORT_GDI_ARB', BOOL), + ('WGL_SUPPORT_OPENGL_ARB', BOOL), + ('WGL_DOUBLE_BUFFER_ARB', BOOL), + ('WGL_STEREO_ARB', BOOL), + ('WGL_PIXEL_TYPE_ARB', FakeEnum(Int, ['WGL_TYPE_RGBA_ARB', 'WGL_TYPE_COLORINDEX_ARB'])), + ('WGL_COLOR_BITS_ARB', Int), + ('WGL_RED_BITS_ARB', Int), + ('WGL_RED_SHIFT_EXT', Int), # not in ...ARB + ('WGL_GREEN_BITS_ARB', Int), + ('WGL_GREEN_SHIFT_EXT', Int), # not in ...ARB + ('WGL_BLUE_BITS_ARB', Int), + ('WGL_BLUE_SHIFT_EXT', Int), # not in ...ARB + ('WGL_ALPHA_BITS_ARB', Int), + ('WGL_ALPHA_SHIFT_EXT', Int), # not in ...ARB + ('WGL_ACCUM_BITS_ARB', Int), + ('WGL_ACCUM_RED_BITS_ARB', Int), + ('WGL_ACCUM_GREEN_BITS_ARB', Int), + ('WGL_ACCUM_BLUE_BITS_ARB', Int), + ('WGL_ACCUM_ALPHA_BITS_ARB', Int), + ('WGL_DEPTH_BITS_ARB', Int), + ('WGL_STENCIL_BITS_ARB', Int), + ('WGL_AUX_BUFFERS_ARB', Int) +]) + +WGLCreatePbufferARBAttribs = AttribArray(WGLenum, [ + ('WGL_PBUFFER_LARGEST_ARB', Int) +]) + +CubeFaceEnum = FakeEnum(Int, [ + 'WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB', + 'WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB', + 'WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB', + 'WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB', + 'WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB', + 'WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB' +]) + +WGLSetPbufferARBAttribs = AttribArray(WGLenum, [ + ('WGL_MIPMAP_LEVEL_ARB', Int), + ('WGL_CUBE_MAP_FACE_ARB', CubeFaceEnum) +]) + HPBUFFERARB = Alias("HPBUFFERARB", HANDLE) @@ -188,14 +280,14 @@ 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"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribIList)"), "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"), (Array(Const(FLOAT), "_AttribPairList_size(pfAttribFList)"), "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")]), StdFunction(HDC, "wglGetCurrentReadDCARB", [], sideeffects=False), # WGL_ARB_pbuffer - StdFunction(HPBUFFERARB, "wglCreatePbufferARB", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribList)"), "piAttribList")]), + StdFunction(HPBUFFERARB, "wglCreatePbufferARB", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (WGLCreatePbufferARBAttribs, "piAttribList")]), StdFunction(HDC, "wglGetPbufferDCARB", [(HPBUFFERARB, "hPbuffer")]), StdFunction(Int, "wglReleasePbufferDCARB", [(HPBUFFERARB, "hPbuffer"), (HDC, "hDC")]), StdFunction(BOOL, "wglDestroyPbufferARB", [(HPBUFFERARB, "hPbuffer")]), @@ -204,7 +296,7 @@ wglapi.addFunctions([ # WGL_ARB_render_texture StdFunction(BOOL, "wglBindTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]), StdFunction(BOOL, "wglReleaseTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]), - StdFunction(BOOL, "wglSetPbufferAttribARB", [(HPBUFFERARB, "hPbuffer"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribList)"), "piAttribList")]), + StdFunction(BOOL, "wglSetPbufferAttribARB", [(HPBUFFERARB, "hPbuffer"), (WGLSetPbufferARBAttribs, "piAttribList")]), # WGL_ARB_create_context StdFunction(HGLRC, "wglCreateContextAttribsARB", [(HDC, "hDC"), (HGLRC, "hShareContext"), (WGLContextAttribs, "attribList")]), @@ -219,7 +311,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"), (Array(Const(WGLenum), "_AttribPairList_size(piAttribIList)"), "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"), (Array(Const(FLOAT), "_AttribPairList_size(pfAttribFList)"), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "*nNumFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), # WGL_EXT_swap_control StdFunction(BOOL, "wglSwapIntervalEXT", [(Int, "interval")]),