Hello
I am testing this very simple SDL2 code in an android phone (Samsung Galaxy S III)
The code runs perfectly in win32. However in the Galaxy S3:
1st appears the color BLUE (the right color) for less than 1 second and then immediately it changes to YELLOW.
The same thing happens when I try other colors. Never shows the right color.
I am using SDL2-2.0.8 and ubuntu 16.04
What I is wrong ?
#include <SDL.h>
int main(int args, char* argvs[])
{
SDL_Window *window = NULL;
SDL_Renderer *renderer = NULL;
int isRunning = 1;
SDL_Event event;
int dx = 800, dy = 600;
if (SDL_Init( SDL_INIT_EVERYTHING ) != -1) {
if (SDL_GetCurrentDisplayMode(0, &displayMode) == 0) {
dx = displayMode.w;
dy = displayMode.h;
}
window = SDL_CreateWindow( "SDL 2 Test",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
dx, dy, SDL_WINDOW_SHOWN );
if (window != NULL) {
renderer = SDL_CreateRenderer( window, -1,
SDL_RENDERER_ACCELERATED );
if (renderer != NULL) {
while (isRunning) {
if (SDL_PollEvent( &event )) {
if (event.type == SDL_QUIT)
isRunning = 0;
}
/* Must show BLUE color. However after less then 1 second it turns to YELLOW */
SDL_SetRenderDrawColor( renderer, 0, 0, 255, SDL_ALPHA_OPAQUE );
SDL_RenderClear( renderer );
SDL_RenderPresent( renderer );
SDL_Delay( 100 );
}
SDL_DestroyRenderer( renderer );
}
SDL_DestroyWindow( window );
}
SDL_Quit( );
}
return (0);
}