… | |
… | |
2366 | }; |
2366 | }; |
2367 | |
2367 | |
2368 | int x, y; |
2368 | int x, y; |
2369 | |
2369 | |
2370 | glEnable (GL_TEXTURE_2D); |
2370 | glEnable (GL_TEXTURE_2D); |
|
|
2371 | /* GL_REPLACE would be correct, as we don't need to modulate alpha, |
|
|
2372 | * but the nvidia driver (185.18.14) mishandles alpha textures |
|
|
2373 | * ansd takes the colour from god knows where instead of using |
|
|
2374 | * Cp. MODULATE results in the same colour, but slightly different |
|
|
2375 | * alpha, but atcually gives us the correct colour with nvidia. |
|
|
2376 | */ |
2371 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); |
2377 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
2372 | glEnable (GL_BLEND); |
2378 | glEnable (GL_BLEND); |
2373 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
2379 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
2374 | glBegin (GL_QUADS); |
2380 | glBegin (GL_QUADS); |
2375 | |
2381 | |
2376 | for (y = 0; y < h; y++) |
2382 | for (y = 0; y < h; y++) |
… | |
… | |
2383 | float *c = color [m & 15]; |
2389 | float *c = color [m & 15]; |
2384 | |
2390 | |
2385 | float tx1 = m & 0x40 ? 0.5 : 0.; |
2391 | float tx1 = m & 0x40 ? 0.5 : 0.; |
2386 | float tx2 = tx1 + 0.5; |
2392 | float tx2 = tx1 + 0.5; |
2387 | |
2393 | |
2388 | glColor4f (c[0], c[1], c[2], 0.75); |
2394 | glColor4f (c[0], c[1], c[2], 1); |
2389 | glTexCoord2f (tx1, 0.); glVertex2i (x , y ); |
2395 | glTexCoord2f (tx1, 0.); glVertex2i (x , y ); |
2390 | glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); |
2396 | glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); |
2391 | glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); |
2397 | glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); |
2392 | glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); |
2398 | glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); |
2393 | } |
2399 | } |
… | |
… | |
2950 | const_iv (GL_NICEST), |
2956 | const_iv (GL_NICEST), |
2951 | const_iv (GL_V2F), |
2957 | const_iv (GL_V2F), |
2952 | const_iv (GL_V3F), |
2958 | const_iv (GL_V3F), |
2953 | const_iv (GL_T2F_V3F), |
2959 | const_iv (GL_T2F_V3F), |
2954 | const_iv (GL_T2F_N3F_V3F), |
2960 | const_iv (GL_T2F_N3F_V3F), |
|
|
2961 | const_iv (GL_FUNC_ADD), |
|
|
2962 | const_iv (GL_FUNC_SUBTRACT), |
|
|
2963 | const_iv (GL_FUNC_REVERSE_SUBTRACT), |
2955 | # undef const_iv |
2964 | # undef const_iv |
2956 | }; |
2965 | }; |
2957 | |
2966 | |
2958 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
2967 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
2959 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
2968 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
… | |
… | |
2966 | disable_GL_EXT_blend_func_separate () |
2975 | disable_GL_EXT_blend_func_separate () |
2967 | CODE: |
2976 | CODE: |
2968 | gl.BlendFuncSeparate = 0; |
2977 | gl.BlendFuncSeparate = 0; |
2969 | gl.BlendFuncSeparateEXT = 0; |
2978 | gl.BlendFuncSeparateEXT = 0; |
2970 | |
2979 | |
|
|
2980 | void |
|
|
2981 | apple_nvidia_bug (int enable) |
|
|
2982 | |
2971 | char * |
2983 | char * |
2972 | gl_vendor () |
2984 | gl_vendor () |
2973 | CODE: |
2985 | CODE: |
2974 | RETVAL = (char *)glGetString (GL_VENDOR); |
2986 | RETVAL = (char *)glGetString (GL_VENDOR); |
2975 | OUTPUT: |
2987 | OUTPUT: |
… | |
… | |
3023 | void glBlendFunc (int sfactor, int dfactor) |
3035 | void glBlendFunc (int sfactor, int dfactor) |
3024 | |
3036 | |
3025 | void glBlendFuncSeparate (int sa, int da, int saa, int daa) |
3037 | void glBlendFuncSeparate (int sa, int da, int saa, int daa) |
3026 | CODE: |
3038 | CODE: |
3027 | gl_BlendFuncSeparate (sa, da, saa, daa); |
3039 | gl_BlendFuncSeparate (sa, da, saa, daa); |
|
|
3040 | |
|
|
3041 | void glBlendEquation (int se) |
3028 | |
3042 | |
3029 | void glDepthMask (int flag) |
3043 | void glDepthMask (int flag) |
3030 | |
3044 | |
3031 | void glLogicOp (int opcode) |
3045 | void glLogicOp (int opcode) |
3032 | |
3046 | |