Skip to content

Commit

Permalink
Try to use hardware surfaces instead of software ones
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Mar 3, 2014
1 parent 22c497c commit a73d9e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/video/gl/gl_renderer.cpp
Expand Up @@ -389,9 +389,9 @@ GLRenderer::do_take_screenshot()
SDL_Surface *shot_surf;
// create surface to hold screenshot
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
shot_surf = SDL_CreateRGBSurface(SDL_SWSURFACE, SCREEN_WIDTH, SCREEN_HEIGHT, 24, 0x00FF0000, 0x0000FF00, 0x000000FF, 0);
shot_surf = SDL_CreateRGBSurface(SDL_HWSURFACE, SCREEN_WIDTH, SCREEN_HEIGHT, 24, 0x00FF0000, 0x0000FF00, 0x000000FF, 0);
#else
shot_surf = SDL_CreateRGBSurface(SDL_SWSURFACE, SCREEN_WIDTH, SCREEN_HEIGHT, 24, 0x000000FF, 0x0000FF00, 0x00FF0000, 0);
shot_surf = SDL_CreateRGBSurface(SDL_HWSURFACE, SCREEN_WIDTH, SCREEN_HEIGHT, 24, 0x000000FF, 0x0000FF00, 0x00FF0000, 0);
#endif
if (!shot_surf) {
log_warning << "Could not create RGB Surface to contain screenshot" << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions src/video/gl/gl_texture.cpp
Expand Up @@ -93,11 +93,11 @@ GLTexture::GLTexture(SDL_Surface* image) :
image_height = image->h;

#if SDL_BYTEORDER == SDL_BIG_ENDIAN
SDL_Surface* convert = SDL_CreateRGBSurface(SDL_SWSURFACE,
SDL_Surface* convert = SDL_CreateRGBSurface(SDL_HWSURFACE,
texture_width, texture_height, 32,
0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff);
#else
SDL_Surface* convert = SDL_CreateRGBSurface(SDL_SWSURFACE,
SDL_Surface* convert = SDL_CreateRGBSurface(SDL_HWSURFACE,
texture_width, texture_height, 32,
0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/video/sdl/sdl_renderer.cpp
Expand Up @@ -127,7 +127,7 @@ SDLRenderer::SDLRenderer() :
log_info << "Software to hardware blits with alpha are " << (info->blit_sw_A ? "" : "not ") << "accelerated." << std::endl;
log_info << "Color fills are " << (info->blit_fill ? "" : "not ") << "accelerated." << std::endl;

int flags = SDL_SWSURFACE | SDL_ANYFORMAT;
int flags = SDL_HWSURFACE | SDL_ANYFORMAT;
if(g_config->use_fullscreen)
flags |= SDL_FULLSCREEN;

Expand Down

0 comments on commit a73d9e6

Please sign in to comment.