I am trying to render a square after SDL_RenderPresent() as I want to render the rectangle to the screen without disturbing other stuff or clearing the screen.
SDL_Event event;
SDL_RenderClear(renderer);
SDL_Rect rect;
rect.x = 10;
rect.y = 10;
rect.w = 100;
rect.h = 100;
SDL_Rect nice;
nice.h = 100;
nice.w = 100;
nice.x = 130;
nice.y = 123;
SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE);
SDL_RenderFillRect(renderer, &rect);
SDL_RenderPresent(renderer);
SDL_RenderFillRect(renderer, &nice);
SDL_RenderPresent(renderer);
while (SDL_WaitEvent(&event)) {
if (event.type == SDL_QUIT)
break;
}
only the second square get rendered , the first square does not appear on the screen