15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_make_current_read 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci WGL_EXT_make_current_read 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciVersion 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Date: 3/1/1999 Version: 1.5 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNumber 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci 169 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciDependencies 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci WGL_EXT_extensions_string is required. 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ciOverview 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ci The association of a separate "read" and "draw" DC with the current 245bd8deadSopenharmony_ci context allows for preprocessing of image data in an "off screen" 255bd8deadSopenharmony_ci DC which is then read into a visible DC for final display. 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNew Procedures and Functions 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci BOOL wglMakeContextCurrentEXT(HDC hDrawDC, 305bd8deadSopenharmony_ci HDC hReadDC, 315bd8deadSopenharmony_ci HGLRC hglrc); 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci HDC wglGetCurrentReadDCEXT(VOID); 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ciNew Tokens 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci Returned by GetLastError (when wglMakeContextCurrentEXT fails): 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.2 GL Specification (OpenGL Operation) 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci None 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2 GL Specification (Rasterization) 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci None 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations 505bd8deadSopenharmony_ciand the Frame buffer) 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci [The following restriction is added to the end of the introductory 535bd8deadSopenharmony_ci paragraph of section 4.2.4] 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci Accumulation operations are only allowed when the device context used 565bd8deadSopenharmony_ci for reading is identical to the device context used for drawing. 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci [The list of error conditions at the end of section 4.2.4] 595bd8deadSopenharmony_ci If there is no accumulation buffer, or the GL is in color index mode, 605bd8deadSopenharmony_ci or if the read device context and the draw device context are not 615bd8deadSopenharmony_ci identical, Accum generates the error INVALID_OPERATION. 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2 Specification (Special Functions) 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci None 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2 Specification (State and State Requests) 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci None 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ciAdditions to the WGL specification 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci The function wglMakeContextCurrentEXT associates the context <hglrc> 745bd8deadSopenharmony_ci with the device <hDrawDC> for draws and the device <hReadDC> for 755bd8deadSopenharmony_ci reads. All subsequent OpenGL calls made by the calling thread are 765bd8deadSopenharmony_ci drawn on the device identified by <hDrawDC> and read on the device 775bd8deadSopenharmony_ci identified by <hReadDC>. 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci The <hDrawDC> and <hReadDC> parameters must refer to drawing surfaces 805bd8deadSopenharmony_ci supported by OpenGL. These parameters need not be the same <hdc> 815bd8deadSopenharmony_ci that was passed to wglCreateContext when <hglrc> was created. 825bd8deadSopenharmony_ci <hDrawDC> must have the same pixel format and be created on the 835bd8deadSopenharmony_ci same device as the <hdc> that was passed into wlgCreateContext. 845bd8deadSopenharmony_ci <hReadDC> must be created on the same device as the <hdc> that was 855bd8deadSopenharmony_ci passed to wglCreateContext and it must support the same pixel type 865bd8deadSopenharmony_ci as the pixel format of the <hdc> that was passed to wglCreateContext. 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci If wglMakeContextCurrentEXT is used to associate a different device 895bd8deadSopenharmony_ci for reads than for draws, the "read" device will be used for the 905bd8deadSopenharmony_ci following OpenGL operations: 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci 1. Any pixel data that are sourced based on the value of READ_BUFFER. 935bd8deadSopenharmony_ci Note, that accumulation operations use the value of READ_BUFFER, 945bd8deadSopenharmony_ci but are not allowed when a different rendering context is used 955bd8deadSopenharmony_ci for reads. 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci 2. Any depth values that are retrieved by glReadPixels, glCopyPixels, 985bd8deadSopenharmony_ci or any OpenGL extension that sources depth images from the frame 995bd8deadSopenharmony_ci buffer in the manner of glReadPixels and glCopyPixels. 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci 3. Any stencil values that are retrieved by glReadPixels, glCopyPixels, 1025bd8deadSopenharmony_ci or any OpenGL extension that sources stencil images from the frame 1035bd8deadSopenharmony_ci buffer in the manner of glReadPixels and glCopyPixels. 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci These frame buffer values are taken from the surface associated with 1065bd8deadSopenharmony_ci the device context specified by <hReadDC>. 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci No error will be generated if the value of READ_BUFFER at the time the 1095bd8deadSopenharmony_ci wglMakeContextCurrentEXT call is made does not correspond to a valid color 1105bd8deadSopenharmony_ci buffer in <hReadDC>. Also, no error due to READ_BUFFER mismatch will be 1115bd8deadSopenharmony_ci generated by subsequent calls to any of the operations enumerated 1125bd8deadSopenharmony_ci above, but the pixels values used will be undefined until READ_BUFFER 1135bd8deadSopenharmony_ci is set to a color buffer that is valid in the <hReadDC>. Operations that 1145bd8deadSopenharmony_ci query the value of READ_BUFFER (i.e., glGet, glPushAttrib) use the 1155bd8deadSopenharmony_ci value set last in the context, independent of whether it is a valid 1165bd8deadSopenharmony_ci buffer in <hReadDC>. 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci Error conditions set by glReadBuffer (even when called implicitly via 1195bd8deadSopenharmony_ci glPopAttrib) and by the operations enumerated above are with respect 1205bd8deadSopenharmony_ci to color and ancillary buffers available in <hReadDC> (i.e., 1215bd8deadSopenharmony_ci glReadBuffer(GL_BACK_BUFFER) will generate an error when <hReadDC> is 1225bd8deadSopenharmony_ci single buffered, and so will an operation that tries to source stencil 1235bd8deadSopenharmony_ci images when <hReadDC> does not have a stencil buffer). 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci If wglMakeContextCurrentEXT succeeds, the return value is TRUE. If 1265bd8deadSopenharmony_ci the function fails, the return value is FALSE. To get extended error 1275bd8deadSopenharmony_ci information, call GetLastError. Possible errors are as follows: 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci ERROR_INVALID_PIXEL_FORMAT The pixel format associated with 1305bd8deadSopenharmony_ci <hDrawDC> does not match the pixel 1315bd8deadSopenharmony_ci format associated with the render 1325bd8deadSopenharmony_ci context. 1335bd8deadSopenharmony_ci ERROR_INVALID_PIXEL_TYPE_EXT The pixel type for <hReadDC> is 1345bd8deadSopenharmony_ci different than the pixel type 1355bd8deadSopenharmony_ci associated with the <hdc> that was 1365bd8deadSopenharmony_ci passed to wglCreateContext. 1375bd8deadSopenharmony_ci ERROR_DC_NOT_FOUND <hReadDC> or <hDrawDC> is not a valid 1385bd8deadSopenharmony_ci device context. 1395bd8deadSopenharmony_ci ERROR_NO_SYSTEM_RESOURCES The device contexts specified by 1405bd8deadSopenharmony_ci <hReadDC> and <hDrawDC> cannot exist 1415bd8deadSopenharmony_ci in the framebuffer simultaneously. 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci wglGetCurrentReadDC returns a handle to the "read" device context that 1445bd8deadSopenharmony_ci is associated with the current OpenGL rendering context of the calling 1455bd8deadSopenharmony_ci thread. If the calling thread does not have a current context, the 1465bd8deadSopenharmony_ci return value is NULL. 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci Because there is no way to extend wgl, these calls are defined in the 1495bd8deadSopenharmony_ci ICD and can be called by obtaining the address with wglGetProcAddress. 1505bd8deadSopenharmony_ci Because this is not a GL extension, it is not included in the 1515bd8deadSopenharmony_ci GL_EXTENSIONS string. 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ciNew State 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci None 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ciNew Implementation Dependent State 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci None 160