It depends on your porting strategy. If you’re using
SDL_GetWindowSurface(), then use SDL_UpdateWindowSurfaceRects().
Otherwise, using hardware SDL_Renderer, there is no analogous function; you
are expected to refresh the whole screen all at once with
SDL_RenderPresent().
Jonny DOn Thu, May 12, 2016 at 10:59 AM, AmigaBlitter wrote:
Migration guide is a bit vague on this:
"That’s right, if you’ve been using SDL_UpdateRect() or SDL_Flip() to get
your bits to the screen, the render API uses SDL_RenderPresent(). "
can anyone help me in creating a routine to find a screen mode with specific mode or pixel format?
in SDL1 the routine is as follow:
Code:
static long find_screen_modes (struct SDL_PixelFormat *vfmt, SDL_Rect *mode_list, int mode_list_size)
{
long count = 0;
SDL_Rect **modes = SDL_ListModes (vfmt, SDL_FULLSCREEN | SDL_HWSURFACE);
if (modes != 0 && modes != (SDL_Rect**)-1) {
unsigned int i;
int w = -1;
int h = -1;
/* Filter list of modes SDL gave us and ignore duplicates */
for (i = 0; modes[i] && count < mode_list_size; i++) {
if (modes[i]->w != w || modes[i]->h != h) {
mode_list[count].w = w = modes[i]->w;
mode_list[count].h = h = modes[i]->h;
count++;
write_log ("SDLGFX: Found screenmode: %dx%d.\n", w, h);
}
}
} else
count = (long) modes;
return count;
}
i have some difficulty to create an SDL2 version of this function