X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wglapi.py;h=33bcea00144efa09bfaf0ebb6e78b01e44ae38fc;hb=bfa8b255d1fdfe68f595c189e75eb44a312c8567;hp=7992138c4375263580f7d2e393c4193a820ef22a;hpb=a9e80d06b649c0b0ec191c8c56a390688b5d73c1;p=apitrace diff --git a/wglapi.py b/wglapi.py index 7992138..33bcea0 100644 --- a/wglapi.py +++ b/wglapi.py @@ -24,12 +24,15 @@ ##########################################################################/ +"""WGL API description""" + + from glapi import * -from windows import * +from winapi import * +from wglenum import * wglapi = API("WGL") -wglapi.add_functions(glapi.functions) HGLRC = Alias("HGLRC", HANDLE) @@ -50,6 +53,7 @@ PFD = Flags(DWORD, [ "PFD_SWAP_LAYER_BUFFERS", "PFD_GENERIC_ACCELERATED", "PFD_SUPPORT_DIRECTDRAW", + "PFD_SUPPORT_COMPOSITION", "PFD_DEPTH_DONTCARE", "PFD_DOUBLEBUFFER_DONTCARE", "PFD_STEREO_DONTCARE", @@ -130,87 +134,39 @@ LAYERPLANEDESCRIPTOR = Struct("LAYERPLANEDESCRIPTOR", [ LPLAYERPLANEDESCRIPTOR = Pointer(LAYERPLANEDESCRIPTOR) WGLSWAP = Struct("WGLSWAP", [ - (HDC, "hdc"), + (HDC, "hdc"), (UINT, "uiFlags"), ]) -attribute = FakeEnum(Int, [ - "WGL_NUMBER_PIXEL_FORMATS_EXT", - "WGL_DRAW_TO_WINDOW_EXT", - "WGL_DRAW_TO_BITMAP_EXT", - "WGL_ACCELERATION_EXT", - "WGL_NEED_PALETTE_EXT", - "WGL_NEED_SYSTEM_PALETTE_EXT", - "WGL_SWAP_LAYER_BUFFERS_EXT", - "WGL_SWAP_METHOD_EXT", - "WGL_NUMBER_OVERLAYS_EXT", - "WGL_NUMBER_UNDERLAYS_EXT", - "WGL_TRANSPARENT_EXT", - "WGL_TRANSPARENT_VALUE_EXT", - "WGL_SHARE_DEPTH_EXT", - "WGL_SHARE_STENCIL_EXT", - "WGL_SHARE_ACCUM_EXT", - "WGL_SUPPORT_GDI_EXT", - "WGL_SUPPORT_OPENGL_EXT", - "WGL_DOUBLE_BUFFER_EXT", - "WGL_STEREO_EXT", - "WGL_PIXEL_TYPE_EXT", - "WGL_COLOR_BITS_EXT", - "WGL_RED_BITS_EXT", - "WGL_RED_SHIFT_EXT", - "WGL_GREEN_BITS_EXT", - "WGL_GREEN_SHIFT_EXT", - "WGL_BLUE_BITS_EXT", - "WGL_BLUE_SHIFT_EXT", - "WGL_ALPHA_BITS_EXT", - "WGL_ALPHA_SHIFT_EXT", - "WGL_ACCUM_BITS_EXT", - "WGL_ACCUM_RED_BITS_EXT", - "WGL_ACCUM_GREEN_BITS_EXT", - "WGL_ACCUM_BLUE_BITS_EXT", - "WGL_ACCUM_ALPHA_BITS_EXT", - "WGL_DEPTH_BITS_EXT", - "WGL_STENCIL_BITS_EXT", - "WGL_AUX_BUFFERS_EXT", - "WGL_NO_ACCELERATION_EXT", - "WGL_GENERIC_ACCELERATION_EXT", - "WGL_FULL_ACCELERATION_EXT", - "WGL_SWAP_EXCHANGE_EXT", - "WGL_SWAP_COPY_EXT", - "WGL_SWAP_UNDEFINED_EXT", - "WGL_TYPE_RGBA_EXT", - "WGL_TYPE_COLORINDEX_EXT", -]) - HPBUFFERARB = Alias("HPBUFFERARB", HANDLE) wglapi.add_functions([ # WGL - StdFunction(BOOL, "wglCopyContext", [(HGLRC, "hglrcSrc"), (HGLRC, "hglrcDst"), (UINT, "mask")]), StdFunction(HGLRC, "wglCreateContext", [(HDC, "hdc")]), - StdFunction(HGLRC, "wglCreateLayerContext", [(HDC, "hdc"), (Int, "iLayerPlane")]), StdFunction(BOOL, "wglDeleteContext", [(HGLRC, "hglrc")]), StdFunction(HGLRC, "wglGetCurrentContext", [], sideeffects=False), - StdFunction(HDC, "wglGetCurrentDC", [], sideeffects=False), - StdFunction(PROC, "wglGetDefaultProcAddress", [(LPCSTR, "lpszProc")], sideeffects=False), + StdFunction(BOOL, "wglMakeCurrent", [(HDC, "hdc"), (HGLRC, "hglrc")]), + StdFunction(BOOL, "wglCopyContext", [(HGLRC, "hglrcSrc"), (HGLRC, "hglrcDst"), (UINT, "mask")]), StdFunction(Int, "wglChoosePixelFormat", [(HDC, "hdc"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]), StdFunction(Int, "wglDescribePixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (UINT, "nBytes"), Out(Pointer(PIXELFORMATDESCRIPTOR), "ppfd")]), + StdFunction(HDC, "wglGetCurrentDC", [], sideeffects=False), + StdFunction(PROC, "wglGetDefaultProcAddress", [(LPCSTR, "lpszProc")], sideeffects=False), StdFunction(Int, "wglGetPixelFormat", [(HDC, "hdc")], sideeffects=False), StdFunction(BOOL, "wglSetPixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]), - StdFunction(BOOL, "wglMakeCurrent", [(HDC, "hdc"), (HGLRC, "hglrc")]), + StdFunction(BOOL, "wglSwapBuffers", [(HDC, "hdc")]), StdFunction(BOOL, "wglShareLists", [(HGLRC, "hglrc1"), (HGLRC, "hglrc2")]), + StdFunction(HGLRC, "wglCreateLayerContext", [(HDC, "hdc"), (Int, "iLayerPlane")]), + StdFunction(BOOL, "wglDescribeLayerPlane", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nBytes"), Out(Pointer(LAYERPLANEDESCRIPTOR), "plpd")]), + StdFunction(Int, "wglSetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), (Array(Const(COLORREF), "cEntries"), "pcr")]), + StdFunction(Int, "wglGetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), Out(Array(COLORREF, "cEntries"), "pcr")], sideeffects=False), + StdFunction(BOOL, "wglRealizeLayerPalette", [(HDC, "hdc"), (Int, "iLayerPlane"), (BOOL, "bRealize")]), + StdFunction(BOOL, "wglSwapLayerBuffers", [(HDC, "hdc"), (UINT, "fuPlanes")]), StdFunction(BOOL, "wglUseFontBitmapsA", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase")]), StdFunction(BOOL, "wglUseFontBitmapsW", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase")]), - StdFunction(BOOL, "wglSwapBuffers", [(HDC, "hdc")]), + StdFunction(DWORD, "wglSwapMultipleBuffers", [(UINT, "n"), (Array(Const(WGLSWAP), "n"), "ps")]), StdFunction(BOOL, "wglUseFontOutlinesA", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase"), (FLOAT, "deviation"), (FLOAT, "extrusion"), (Int, "format"), (LPGLYPHMETRICSFLOAT, "lpgmf")]), StdFunction(BOOL, "wglUseFontOutlinesW", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase"), (FLOAT, "deviation"), (FLOAT, "extrusion"), (Int, "format"), (LPGLYPHMETRICSFLOAT, "lpgmf")]), - StdFunction(BOOL , "wglDescribeLayerPlane", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nBytes"), Out(Pointer(LAYERPLANEDESCRIPTOR), "plpd")]), - StdFunction(Int , "wglSetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), (Array(Const(COLORREF), "cEntries"), "pcr")]), - StdFunction(Int , "wglGetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), Out(Array(COLORREF, "cEntries"), "pcr")], sideeffects=False), - StdFunction(BOOL , "wglRealizeLayerPalette", [(HDC, "hdc"), (Int, "iLayerPlane"), (BOOL, "bRealize")]), - StdFunction(BOOL , "wglSwapLayerBuffers", [(HDC, "hdc"), (UINT, "fuPlanes")]), - StdFunction(DWORD, "wglSwapMultipleBuffers", [(UINT, "n"), (Array(Const(WGLSWAP), "n"), "ps")]), # WGL_ARB_buffer_region StdFunction(HANDLE, "wglCreateBufferRegionARB", [(HDC, "hDC"), (Int, "iLayerPlane"), (UINT, "uType")]), @@ -221,25 +177,49 @@ wglapi.add_functions([ # WGL_ARB_extensions_string StdFunction(Const(CString), "wglGetExtensionsStringARB", [(HDC, "hdc")], sideeffects=False), + # 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"), (Const(Array(WGLenum, "__AttribList_size(piAttribIList)")), "piAttribIList"), (Const(Array(FLOAT, "__AttribList_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"), (Pointer(Const(Int)), "piAttribList")]), - StdFunction(HDC, "wglGetPbufferDCARB", [(HPBUFFERARB, "hPbuffer")], sideeffects=False), + StdFunction(HPBUFFERARB, "wglCreatePbufferARB", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (Const(Array(WGLenum, "__AttribList_size(piAttribList)")), "piAttribList")]), + StdFunction(HDC, "wglGetPbufferDCARB", [(HPBUFFERARB, "hPbuffer")]), StdFunction(Int, "wglReleasePbufferDCARB", [(HPBUFFERARB, "hPbuffer"), (HDC, "hDC")]), StdFunction(BOOL, "wglDestroyPbufferARB", [(HPBUFFERARB, "hPbuffer")]), - StdFunction(BOOL, "wglQueryPbufferARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iAttribute"), Out(Pointer(Int), "piValue")]), + StdFunction(BOOL, "wglQueryPbufferARB", [(HPBUFFERARB, "hPbuffer"), (WGLenum, "iAttribute"), Out(Pointer(Int), "piValue")], sideeffects=False), - # WGL_ARB_pixel_format - StdFunction(BOOL, "wglGetPixelFormatAttribivARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False), - StdFunction(BOOL, "wglGetPixelFormatAttribfvARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False), - StdFunction(BOOL, "wglChoosePixelFormatARB", [(HDC, "hdc"), (Pointer(Const(Int)), "piAttribIList"), (Pointer(Const(FLOAT)), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "nMaxFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), + # WGL_ARB_render_texture + StdFunction(BOOL, "wglBindTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]), + StdFunction(BOOL, "wglReleaseTexImageARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iBuffer")]), + StdFunction(BOOL, "wglSetPbufferAttribARB", [(HPBUFFERARB, "hPbuffer"), (Const(Array(WGLenum, "__AttribList_size(piAttribList)")), "piAttribList")]), + + # WGL_ARB_create_context + StdFunction(HGLRC, "wglCreateContextAttribsARB", [(HDC, "hDC"), (HGLRC, "hShareContext"), (Const(Array(WGLenum, "__AttribList_size(attribList)")), "attribList")]), # WGL_EXT_extensions_string StdFunction(Const(CString), "wglGetExtensionsStringEXT", [], sideeffects=False), + # WGL_EXT_make_current_read + StdFunction(BOOL, "wglMakeContextCurrentEXT", [(HDC, "hDrawDC"), (HDC, "hReadDC"), (HGLRC, "hglrc")]), + StdFunction(HDC, "wglGetCurrentReadDCEXT", [], sideeffects=False), + # WGL_EXT_pixel_format - StdFunction(BOOL, "wglGetPixelFormatAttribivEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False), - StdFunction(BOOL, "wglGetPixelFormatAttribfvEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False), - StdFunction(BOOL, "wglChoosePixelFormatEXT", [(HDC, "hdc"), (Pointer(Const(Int)), "piAttribIList"), (Pointer(Const(FLOAT)), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "nMaxFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), + 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"), (Pointer(Const(WGLenum)), "piAttribIList"), (Pointer(Const(FLOAT)), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "nMaxFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), + + # WGL_EXT_swap_control + StdFunction(BOOL, "wglSwapIntervalEXT", [(Int, "interval")]), + StdFunction(Int, "wglGetSwapIntervalEXT", [], sideeffects=False), + + # WGL_NV_vertex_array_range + StdFunction(OpaquePointer(Void), "wglAllocateMemoryNV", [(GLsizei, "size"), (GLfloat, "readfreq"), (GLfloat, "writefreq"), (GLfloat, "priority")]), + StdFunction(Void, "wglFreeMemoryNV", [(OpaquePointer(Void), "pointer")]), # must be last StdFunction(PROC, "wglGetProcAddress", [(LPCSTR, "lpszProc")]),