comparison src/video/SDL_renderer_gl.c @ 1921:f3399f779a1d

Bug fixes to the OpenGL renderer
author Sam Lantinga <slouken@libsdl.org>
date Sat, 22 Jul 2006 18:01:56 +0000
parents 8a162bfdc838
children 4905cac7a4bd
comparison
equal deleted inserted replaced
1920:8a162bfdc838 1921:f3399f779a1d
68 SDL_Renderer_Accelerated), 68 SDL_Renderer_Accelerated),
69 (SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask | 69 (SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
70 SDL_TextureBlendMode_Blend | SDL_TextureBlendMode_Add | 70 SDL_TextureBlendMode_Blend | SDL_TextureBlendMode_Add |
71 SDL_TextureBlendMode_Mod), 71 SDL_TextureBlendMode_Mod),
72 (SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast | 72 (SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast |
73 SDL_TextureScaleMode_Best), 73 SDL_TextureScaleMode_Slow),
74 18, 74 18,
75 { 75 {
76 SDL_PixelFormat_Index1LSB, 76 SDL_PixelFormat_Index1LSB,
77 SDL_PixelFormat_Index1MSB, 77 SDL_PixelFormat_Index1MSB,
78 SDL_PixelFormat_Index8, 78 SDL_PixelFormat_Index8,
283 format = GL_BGRA; 283 format = GL_BGRA;
284 type = GL_UNSIGNED_INT_8_8_8_8_REV; 284 type = GL_UNSIGNED_INT_8_8_8_8_REV;
285 break; 285 break;
286 case SDL_PixelFormat_RGBA8888: 286 case SDL_PixelFormat_RGBA8888:
287 internalFormat = GL_RGBA8; 287 internalFormat = GL_RGBA8;
288 format = GL_BGRA; 288 format = GL_RGBA;
289 type = GL_UNSIGNED_INT_8_8_8_8; 289 type = GL_UNSIGNED_INT_8_8_8_8;
290 break; 290 break;
291 case SDL_PixelFormat_ABGR8888: 291 case SDL_PixelFormat_ABGR8888:
292 internalFormat = GL_RGBA8; 292 internalFormat = GL_RGBA8;
293 format = GL_RGBA; 293 format = GL_RGBA;
500 case SDL_TextureScaleMode_Fast: 500 case SDL_TextureScaleMode_Fast:
501 glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 501 glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
502 glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 502 glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
503 break; 503 break;
504 case SDL_TextureScaleMode_Slow: 504 case SDL_TextureScaleMode_Slow:
505 case SDL_TextureScaleMode_Best:
506 glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 505 glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
507 glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 506 glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
508 break; 507 break;
509 } 508 }
510 509
512 glTexCoord2f(minu, minv); 511 glTexCoord2f(minu, minv);
513 glVertex2i(minx, miny); 512 glVertex2i(minx, miny);
514 glTexCoord2f(maxu, minv); 513 glTexCoord2f(maxu, minv);
515 glVertex2i(maxx, miny); 514 glVertex2i(maxx, miny);
516 glTexCoord2f(minu, maxv); 515 glTexCoord2f(minu, maxv);
517 glVertex2i(miny, maxy); 516 glVertex2i(minx, maxy);
518 glTexCoord2f(maxu, maxv); 517 glTexCoord2f(maxu, maxv);
519 glVertex2i(maxx, maxy); 518 glVertex2i(maxx, maxy);
520 glEnd(); 519 glEnd();
521 520
522 return 0; 521 return 0;