15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci WGL_I3D_image_buffer 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci WGL_I3D_image_buffer 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Dale Kirkland, Intense3D (kirkland 'at' intense3d.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciStatus 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Complete 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciVersion 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Date: 04/18/2000 Revision 1.0 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ciNumber 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ci 253 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ciDependencies 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ci The extension is written against the OpenGL 1.2.1 Specification 285bd8deadSopenharmony_ci although it should work on any previous OpenGL specification. 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci The WGL_EXT_extensions_string extension is required. 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciOverview 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci The image buffer extension provides an interface to allocate one 355bd8deadSopenharmony_ci or more memory buffers to be used for GL image functions. These 365bd8deadSopenharmony_ci functions include DrawPixels, ReadPixels, TexImage*D, and 375bd8deadSopenharmony_ci TexSubImage*D. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci The advantage of an image buffer over normal allocated memory is 405bd8deadSopenharmony_ci as follows: 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci o The image buffer may be allocated on the graphics adapter. 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci o The image buffer may be locked once by the implementation thus 455bd8deadSopenharmony_ci avoiding a call to the OS to lock the memory down each use. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci o The data in the image buffer may be transferred to the adapter 485bd8deadSopenharmony_ci using non-snooping accesses. 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci o Multiple events may be associated with the image buffer so that 515bd8deadSopenharmony_ci the data can be transferred asynchronously. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci Since the image buffer is created and maintained by a specific 545bd8deadSopenharmony_ci graphics driver, a DC is required to create the image buffer. 555bd8deadSopenharmony_ci However, the image buffer can be used with any RC created for the 565bd8deadSopenharmony_ci graphics driver associated with the DC. 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ciIP Status 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci None 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ciIssues 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci None 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ciNew Procedures and Functions 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci LPVOID wglCreateImageBufferI3D(HDC hDC, 695bd8deadSopenharmony_ci DWORD dwSize, 705bd8deadSopenharmony_ci UINT uFlags) 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci BOOL wglDestroyImageBufferI3D(HDC hDC, 735bd8deadSopenharmony_ci LPVOID pAddress) 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci BOOL wglAssociateImageBufferEventsI3D(HDC hdc, 765bd8deadSopenharmony_ci HANDLE *pEvent, 775bd8deadSopenharmony_ci LPVOID *pAddress, 785bd8deadSopenharmony_ci DWORD *pSize, 795bd8deadSopenharmony_ci UINT count) 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci BOOL wglReleaseImageBufferEventsI3D(HDC hdc, 825bd8deadSopenharmony_ci LPVOID *pAddress, 835bd8deadSopenharmony_ci UINT count) 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ciNew Tokens 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci Accepted by the <uFlags> parameter of wglCreateImageBufferI3D: 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 905bd8deadSopenharmony_ci WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation) 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci None 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci None 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment 1015bd8deadSopenharmony_ciOperations and the Frame Buffer) 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci None 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci None 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.2.1 Specification (State and 1105bd8deadSopenharmony_ciState Requests) 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci None 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.2.1 Specification (Invariance) 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci None 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ciAdditions to the WGL Specification 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci An image buffer is memory allocated by the GL implementation that 1215bd8deadSopenharmony_ci can be used to store an image for more efficient transfers to the 1225bd8deadSopenharmony_ci graphics adapter. An image buffer is used with the following GL 1235bd8deadSopenharmony_ci image functions: DrawPixels, ReadPixels, TexImage*D, and 1245bd8deadSopenharmony_ci TexSubImage*D. 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci An image buffer is created by calling wglCreateImageBufferI3D: 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci LPVOID wglCreateImageBufferI3D(HDC hDC, 1295bd8deadSopenharmony_ci DWORD dwSize, 1305bd8deadSopenharmony_ci UINT uFlags) 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci <hDC> is a device context for the graphics adapter or a window 1335bd8deadSopenharmony_ci residing on the graphics adapter that supports the image buffer 1345bd8deadSopenharmony_ci extension. The image buffer can only be used for an RC created 1355bd8deadSopenharmony_ci on the graphics adapter associated with <hDC>. 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci <dwSize> is the requested byte size of the image buffer. The 1385bd8deadSopenharmony_ci minimum size is implementation-dependent, but at least <dwSize> 1395bd8deadSopenharmony_ci will be allocated for the image buffer. 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci <uFlags> specifies information about the intended usage of the 1425bd8deadSopenharmony_ci image buffer. 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 1455bd8deadSopenharmony_ci The image buffer is minimally accessed by the application; 1465bd8deadSopenharmony_ci rather, the buffer is loaded by a device (disk, graphics 1475bd8deadSopenharmony_ci adapter, etc.). The implementation may take advantage of 1485bd8deadSopenharmony_ci this and allocate memory that could be slower for the 1495bd8deadSopenharmony_ci host, but faster for devices. Also, the memory may be 1505bd8deadSopenharmony_ci allocated as uncached so that the data in the image buffer 1515bd8deadSopenharmony_ci does not have to be "snooped" during the transfer to or 1525bd8deadSopenharmony_ci from the graphics adapter. 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci WGL_IMAGE_BUFFER_LOCK_I3D 1555bd8deadSopenharmony_ci The image buffer memory is locked or allocated out of 1565bd8deadSopenharmony_ci memory that is not swapped. 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ci If memory is available on the graphics adapter, the implementation 1595bd8deadSopenharmony_ci may choose to use it for the allocation of an image buffer. 1605bd8deadSopenharmony_ci However, the memory must behave like system memory in that it can 1615bd8deadSopenharmony_ci be read and written by system devices or the host. 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci If an image buffer is successfully created, a pointer is returned 1645bd8deadSopenharmony_ci to the image buffer memory. The boundary alignment for the image 1655bd8deadSopenharmony_ci buffer is at least the native alignment of the system (usually 1665bd8deadSopenharmony_ci 32- or 64-bit alignment). 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci An image buffer can be destroyed by calling the function 1695bd8deadSopenharmony_ci wglDestroyImageBufferI3D. 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci BOOL wglDestroyImageBufferI3D(HDC hDC, 1725bd8deadSopenharmony_ci LPVOID pAddress) 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci <pAddress> is a pointer to an image buffer that was obtained from 1755bd8deadSopenharmony_ci a previous call to wglCreateImageBufferI3D. The implementation 1765bd8deadSopenharmony_ci will wait for any outstanding calls that use the image buffer to 1775bd8deadSopenharmony_ci complete before it is destroyed. If there is an event associated 1785bd8deadSopenharmony_ci with the image buffer, it must be freed by the caller after the 1795bd8deadSopenharmony_ci image buffer is destroyed. 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci If the call is successful, a value of TRUE is returned and the 1825bd8deadSopenharmony_ci resources associated with the image buffer are freed. 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci One or more events may be associated with the image buffer by 1855bd8deadSopenharmony_ci calling the function wglAssociateImageBufferEventsI3D. Each 1865bd8deadSopenharmony_ci event can be associated with a region of the image buffer to allow 1875bd8deadSopenharmony_ci asynchronous transfers between the image buffer and the graphics 1885bd8deadSopenharmony_ci adapter. 1895bd8deadSopenharmony_ci 1905bd8deadSopenharmony_ci BOOL wglAssociateImageBufferEventsI3D(HDC hdc, 1915bd8deadSopenharmony_ci HANDLE *pEvent, 1925bd8deadSopenharmony_ci LPVOID *pAddress, 1935bd8deadSopenharmony_ci DWORD *pSize, 1945bd8deadSopenharmony_ci UINT count) 1955bd8deadSopenharmony_ci 1965bd8deadSopenharmony_ci <pEvent> points to an array of events, each of which was created 1975bd8deadSopenharmony_ci with CreateEvent as a manual reset event with the initial state 1985bd8deadSopenharmony_ci set to TRUE (i.e. both the <bManualReset> and <bInitialState> 1995bd8deadSopenharmony_ci arguments must be set to a value of TRUE). All events must be 2005bd8deadSopenharmony_ci unique to only one portion of an image buffer (i.e., events 2015bd8deadSopenharmony_ci cannot be shared). 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci For each event in <pEvent>, a region in the image buffer is defined 2045bd8deadSopenharmony_ci by the corresponding <pAddress> and <pSize> entry. <count> 2055bd8deadSopenharmony_ci specifies the number of events (and associated regions). 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ci All regions for a call to wglAssociateImageBufferEventsI3D must be 2085bd8deadSopenharmony_ci for the same image buffer. Additional events can be added at any 2095bd8deadSopenharmony_ci time. Regions must not overlap. The entire image buffer can be 2105bd8deadSopenharmony_ci defined as a single region. 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci Each region in an image buffer can be used as the image for 2135bd8deadSopenharmony_ci DrawPixels, ReadPixels, TexImage*D, and TexSubImage*D calls. 2145bd8deadSopenharmony_ci Once a call is made to a GL image function, the caller must wait 2155bd8deadSopenharmony_ci for the transfer to complete using WaitForSingleObject before the 2165bd8deadSopenharmony_ci image buffer can be modified (for DrawPixels, TexImage*D, or 2175bd8deadSopenharmony_ci TexSubImage*D) or read (for ReadPixels). 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci If an event is not specified for a region, the GL call using that 2205bd8deadSopenharmony_ci region will complete its transfer before it returns. 2215bd8deadSopenharmony_ci 2225bd8deadSopenharmony_ci Events can be disassociated with their region by calling 2235bd8deadSopenharmony_ci wglReleaseImageBufferEventsI3D. 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci BOOL wglReleaseImageBufferEventsI3D(HDC hdc, 2265bd8deadSopenharmony_ci LPVOID *pAddress, 2275bd8deadSopenharmony_ci UINT count) 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci <pAddress> points to an array of regions previously associated 2305bd8deadSopenharmony_ci with events. <count> is the number of regions in the array. If an 2315bd8deadSopenharmony_ci event is associated with the specified region, it is released. All 2325bd8deadSopenharmony_ci regions specified by <pAddress> must be for the same image buffer. 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ci When an image buffer is destroyed using wglDestroyImageBufferI3D, 2355bd8deadSopenharmony_ci all events for that image buffer are released. It is the 2365bd8deadSopenharmony_ci responsibility of the application to delete events that are no 2375bd8deadSopenharmony_ci longer associated with an image buffer. 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ciDependencies on WGL_EXT_extensions_string 2405bd8deadSopenharmony_ci 2415bd8deadSopenharmony_ci Because there is no way to extend wgl, these calls are defined in 2425bd8deadSopenharmony_ci the ICD and can be called by obtaining the address with 2435bd8deadSopenharmony_ci wglGetProcAddress. Because this extension is a WGL extension, it 2445bd8deadSopenharmony_ci is not included in the GL_EXTENSIONS string. Its existence can be 2455bd8deadSopenharmony_ci determined with the WGL_EXT_extensions_string extension. 2465bd8deadSopenharmony_ci 2475bd8deadSopenharmony_ciErrors 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci If the wglCreateImageBufferI3D function succeeds, a pointer to an 2505bd8deadSopenharmony_ci image buffer is returned. If the function fails, a value of NULL 2515bd8deadSopenharmony_ci is returned. To get extended error information, call GetLastError. 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci ERROR_DC_NOT_FOUND The <hDC> was not valid. 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ci ERROR_NO_SYSTEM_RESOURCES There was insufficient resources to 2565bd8deadSopenharmony_ci support the request. 2575bd8deadSopenharmony_ci 2585bd8deadSopenharmony_ci ERROR_INVALID_DATA <dwSize> is not a positive value. 2595bd8deadSopenharmony_ci 2605bd8deadSopenharmony_ci If the wglDestroyImageBufferI3D function succeeds, a value of TRUE 2615bd8deadSopenharmony_ci is returned. If the function fails, a value of FALSE is returned. 2625bd8deadSopenharmony_ci To get extended error information, call GetLastError. 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci ERROR_DC_NOT_FOUND The <hDC> was not valid. 2655bd8deadSopenharmony_ci 2665bd8deadSopenharmony_ci If the wglAssociateImageBufferEventsI3D or 2675bd8deadSopenharmony_ci wglReleaseImageBufferEventsI3D functions succeed, a value of TRUE 2685bd8deadSopenharmony_ci is returned. If the function fails, a value of FALSE is returned. 2695bd8deadSopenharmony_ci To get extended error information, call GetLastError. 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci ERROR_DC_NOT_FOUND The <hDC> was not valid. 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci ERROR_INVALID_DATA The regions specified by <pAddress> 2745bd8deadSopenharmony_ci are not valid for the specified image 2755bd8deadSopenharmony_ci buffer. 2765bd8deadSopenharmony_ci 2775bd8deadSopenharmony_ciNew State 2785bd8deadSopenharmony_ci 2795bd8deadSopenharmony_ci None 2805bd8deadSopenharmony_ci 2815bd8deadSopenharmony_ciNew Implementation Dependent State 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci None 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ciRevision History 2865bd8deadSopenharmony_ci 2875bd8deadSopenharmony_ci 11/15/1999 0.1 First draft. 2885bd8deadSopenharmony_ci 11/24/1999 0.2 Fixed various typos. 2895bd8deadSopenharmony_ci 03/16/2000 0.3 Changed to add multiple events for a single image 2905bd8deadSopenharmony_ci buffer. 2915bd8deadSopenharmony_ci 04/18/2000 1.0 Released driver to ISVs. 292