Texture cleanup

- Removed unneeded creation of texture in main()
- Changed GUI RGB format to ARGB8888 (32-bit)
This commit is contained in:
Dimitris Panokostas 2017-01-25 12:47:51 +01:00
parent b06d5a6569
commit 474ef81aec
2 changed files with 3 additions and 11 deletions

View file

@ -669,15 +669,7 @@ static int real_main2 (int argc, TCHAR **argv)
check_error_sdl(renderer == nullptr, "Unable to create a renderer");
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); // make the scaled rendering look smoother.
SDL_RenderSetLogicalSize(renderer, 800, 480);
texture = SDL_CreateTexture(renderer,
SDL_PIXELFORMAT_RGB565,
SDL_TEXTUREACCESS_STREAMING,
800,
480);
check_error_sdl(texture == nullptr, "Unable to create texture");
keyboard_settrans();
if (restart_config[0]) {

View file

@ -134,13 +134,13 @@ namespace sdl
// Create new screen for GUI
//-------------------------------------------------
gui_screen = SDL_CreateRGBSurface(0, GUI_WIDTH, GUI_HEIGHT, 16, 0, 0, 0, 0);
gui_screen = SDL_CreateRGBSurface(0, GUI_WIDTH, GUI_HEIGHT, 32, 0, 0, 0, 0);
check_error_sdl(gui_screen == nullptr, "Unable to create a surface");
SDL_RenderSetLogicalSize(renderer, GUI_WIDTH, GUI_HEIGHT);
gui_texture = SDL_CreateTexture(renderer,
SDL_PIXELFORMAT_RGB565,
SDL_PIXELFORMAT_ARGB8888,
SDL_TEXTUREACCESS_STREAMING,
GUI_WIDTH,
GUI_HEIGHT);