I reproduced the issue with this code:
Code:
#include “SDL.h”
#include
#include “SDL_image.h”
int main(int argc, char* args[])
{
// Initiate SDL
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
std::cout << "SDL_Init ERROR: " << SDL_GetError() << std::endl;
}
// Create window
SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandescapeRight");
SDL_DisplayMode displayMode;
SDL_GetCurrentDisplayMode(0, &displayMode);
SDL_Window* window = NULL;
window = SDL_CreateWindow(NULL, 0, 0, displayMode.w, displayMode.h,
SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
if (window == NULL)
{
std::cout << "SDL_CreateWindow ERROR: " << SDL_GetError() << std::endl;
}
// Create renderer
SDL_Renderer* renderer = NULL;
renderer = SDL_CreateRenderer(window, -1, 0);
if (renderer == NULL)
{
std::cout << "SDL_CreateRenderer ERROR: " << SDL_GetError() << std::endl;
}
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
SDL_RenderSetLogicalSize(renderer, 480, 320);
// Load texture
SDL_Texture* texture = NULL;
std::string filePath = "Textures/MenuSystem/MainMenuBackground.png";
SDL_Surface* surface = IMG_Load(filePath.c_str());
if (surface == NULL)
{
std::cout << "ERROR IN: FileUtility::loadTexture() - IMG_Load ERROR: " << filePath.c_str() << " - " << IMG_GetError() << std::endl;
}
else
{
texture = SDL_CreateTextureFromSurface(renderer, surface);
if (texture == NULL)
{
std::cout << "ERROR IN: FileUtility::loadTexture() - SDL_CreateTextureFromSurface ERROR: " << filePath.c_str() << " - " << IMG_GetError() << std::endl;
}
SDL_FreeSurface(surface);
}
// Run loop
bool isRunning = true;
while (isRunning)
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
if (event.type == SDL_QUIT)
{
isRunning = false;
}
}
SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF);
SDL_RenderClear(renderer);
SDL_SetRenderDrawColor(renderer, 0xFF, 0, 0, 0xFF);
SDL_RenderCopy(renderer, texture, NULL, NULL);
SDL_RenderPresent(renderer);
}
// Destroy renderer
SDL_DestroyRenderer(renderer);
// Destroy window
SDL_DestroyWindow(window);
// Quit SDL
SDL_Quit();
return 0;
}
Alex Szpakowski wrote:> I ran the iOS keyboard demo (which uses SDL_Render) and I still can?t reproduce the issue ? do you have a minimal test case available?
Using raw OpenGL (ES) is preferable if you need the level of control it gives compared to the SDL_Render API, but if you don?t then SDL_Render should be fine.
SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)