1Name 2 3 WGL_I3D_gamma 4 5Name Strings 6 7 WGL_I3D_gamma 8 9Contact 10 11 Dale Kirkland, Intense3D (kirkland 'at' intense3d.com) 12 13Status 14 15 Complete 16 17Version 18 19 Date: 04/17/2000 Revision 1.0 20 21Number 22 23 251 24 25Dependencies 26 27 The extension is written against the OpenGL 1.2.1 Specification 28 although it should work on any previous OpenGL specification. 29 30 The WGL_EXT_extensions_string extension is required. 31 32Overview 33 34 The gamma extension provides an interface to read and load the 35 gamma table. Other options such as having gamma only affect 36 OpenGL windows can also be set. 37 38IP Status 39 40 None 41 42Issues 43 44 None 45 46New Procedures and Functions 47 48 BOOL wglGetGammaTableParametersI3D(HDC hDC, 49 int iAttribute, 50 int *piValue) 51 52 BOOL wglSetGammaTableParametersI3D(HDC hDC, 53 int iAttribute, 54 const int *piValue) 55 56 BOOL wglGetGammaTableI3D(HDC hDC, 57 int iEntries, 58 USHORT *puRed, 59 USHORT *puGreen, 60 USHORT *puBlue) 61 62 BOOL wglSetGammaTableI3D(HDC hDC, 63 int iEntries, 64 const USHORT *puRed, 65 const USHORT *puGreen, 66 const USHORT *puBlue) 67 68New Tokens 69 70 Accepted by the <iAttribute> parameter of wglGetGammaTableParametersI3D: 71 72 WGL_GAMMA_TABLE_SIZE_I3D 0x204E 73 WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F 74 75 Accepted by the <iAttribute> parameter of wglSetGammaTableParametersI3D: 76 77 WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F 78 79Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation) 80 81 None 82 83Additions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 84 85 None 86 87Additions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment 88Operations and the Frame Buffer) 89 90 None 91 92Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) 93 94 None 95 96Additions to Chapter 6 of the OpenGL 1.2.1 Specification (State and 97State Requests) 98 99 None 100 101Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance) 102 103 None 104 105Additions to the WGL Specification 106 107 Gamma correction for each monitor that supports a gamma table is 108 controlled by loading the gamma table and setting the appropriate 109 parameters. The function wglSetGammaTableI3D loads the gamma 110 table: 111 112 BOOL wglSetGammaTableI3D(HDC hDC, 113 int iEntries, 114 const USHORT *puRed, 115 const USHORT *puGreen, 116 const USHORT *puBlue) 117 118 <hDC> is a device context for the graphics adapter or a window 119 residing on a monitor whose graphics adapter supports the gamma 120 extension. For multiple monitor systems, only the gamma table 121 associated with <hDC> is loaded. 122 123 The red, green, and blue data for the gamma table are pointed to by 124 <puRed>, <puGreen> and <puBlue> respectively. Each color array 125 must contain <iEntries> entries. Gamma entries specified outside 126 the hardware gamma table are ignored. 127 128 The red, green, and blue data is defined using 16-bit precision. 129 If the hardware gamma table has less than 16 bits of precision, the 130 data is shifted down so that only the most-significant bits are 131 used without rounding. 132 133 The current gamma table can be obtained by calling the function 134 wglGetGammaTableI3D: 135 136 BOOL wglGetGammaTableI3D(HDC hDC, 137 int iEntries, 138 USHORT *puRed, 139 USHORT *puGreen, 140 USHORT *puBlue) 141 142 <hDC> is a device context for the graphics adapter or a window 143 residing on a monitor whose graphics adapter supports the gamma 144 extension. For multiple monitor systems, only the gamma table 145 associated with <hDC> is read. 146 147 <puRed>, <puGreen> and <puBlue> each point to an unsigned-short 148 array containing <iEntries>. If <iEntries> is larger than the 149 hardware gamma table, only the number of entries that correspond to 150 the size of the hardware gamma table will be returned. 151 152 The red, green and blue data is defined using 16-bit precision 153 according to the description above. If the hardware gamma table 154 has less than 16 bits of precision, the data is shifted up. 155 156 Gamma table parameters can be set with the function 157 wglSetGammaTableParametersI3D: 158 159 BOOL wglSetGammaTableParametersI3D(HDC hDC, 160 int iAttribute, 161 const int *piValue) 162 163 <hDC> is a device context for the graphics adapter or a window 164 residing on a monitor whose graphics adapter supports the gamma 165 extension. For multiple monitor systems, only the gamma table 166 associated with <hDC> is set. 167 168 <iAttribute> must be one of the following values: 169 170 WGL_GAMMA_EXCLUDE_DESKTOP_I3D 171 If the value pointed to by <piValue> is non-zero, only the 172 contents of OpenGL windows are gamma corrected; the 173 desktop will not be gamma corrected. If the value pointed 174 to by <piValue> is zero, all windows and the desktop are 175 gamma corrected. This value defaults to zero. 176 177 Gamma table parameters can be queried with the function 178 wglGetGammaTableParametersI3D: 179 180 BOOL wglGetGammaTableParametersI3D(HDC hDC, 181 int iAttribute, 182 int *piValue) 183 184 <hDC> is a device context for the graphics adapter or a window 185 residing on a monitor whose graphics adapter supports the gamma 186 extension. For multiple monitor systems, only the gamma table 187 parameters associated with <hDC> are returned. 188 189 <iAttribute> must be one of the following values: 190 191 WGL_GAMMA_EXCLUDE_DESKTOP_I3D 192 Returns the current setting for desktop gamma correction. 193 If the value returned in the location pointed to by 194 <piValue> is non-zero, only the contents of OpenGL windows 195 are gamma corrected; the desktop will not be gamma 196 corrected. 197 198 WGL_GAMMA_TABLE_SIZE_I3D 199 Returns the number of entries in the hardware gamma table. 200 201Dependencies on WGL_EXT_extensions_string 202 203 Because there is no way to extend wgl, these calls are defined in 204 the ICD and can be called by obtaining the address with 205 wglGetProcAddress. Because this extension is a WGL extension, it 206 is not included in the GL_EXTENSIONS string. Its existence can be 207 determined with the WGL_EXT_extensions_string extension. 208 209Errors 210 211 If the function succeeds, a value of TRUE is returned. If the 212 function fails, a value of FALSE is returned. To get extended 213 error information, call GetLastError. 214 215 ERROR_DC_NOT_FOUND The <hDC> was not valid. 216 217 ERROR_NO_SYSTEM_RESOURCES There is no support for a gamma table 218 for the adapter specified by <hDC>. 219 220 ERROR_INVALID_DATA <iAttribute> is not a valid value. 221 222 ERROR_INVALID_DATA <iEntries> is not a positive value. 223 224New State 225 226 None 227 228New Implementation Dependent State 229 230 None 231 232Revision History 233 234 11/24/1999 0.1 First draft. 235 11/29/1999 0.2 Changed wglGetGammaTableI3D and 236 wglSetGammaTableI3D to accept three pointers, one 237 each for the red, green, and blue data for the 238 gamma table. 239 04/17/2000 1.0 Fixed a few typos. 240 Driver released to ISVs. 241