Afletdinov A.
2013-12-12 02:02:37 UTC
Good day!
1. I can not understand what the difference is, SDL_RenderPresent and
SDL_UpdateWindowSurface.
Example 1:
SDL_Window *window = SDL_CreateWindow("Test 1", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN);
SDL_Renderer *renderer = SDL_CreateSoftwareRenderer(SDL_GetWindowSurface(window));
It will only work this function: SDL_UpdateWindowSurface(window);
Example 2:
SDL_Window *window = SDL_CreateWindow("Test 2", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN);
SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);
It will only work this function: SDL_RenderPresent(renderer);
What are the differences in performance (example1 vs example2)?
2. For the old version SDL1.2, I often used this code: SDL_BlitSurface(SDL_GetVideoSurface(), dstsf, ...).
Do I understand correctly that the new version should use this code:
SDL_CreateTextureFromSurface(renderer, SDL_GetWindowSurface(window)); + SDL_SetRenderTarget + SDL_RenderCopy?
3. SDL_CreateWindowAndRenderer - What type of rendering will be created (software or accelerated)?
Thanks you!
1. I can not understand what the difference is, SDL_RenderPresent and
SDL_UpdateWindowSurface.
Example 1:
SDL_Window *window = SDL_CreateWindow("Test 1", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN);
SDL_Renderer *renderer = SDL_CreateSoftwareRenderer(SDL_GetWindowSurface(window));
It will only work this function: SDL_UpdateWindowSurface(window);
Example 2:
SDL_Window *window = SDL_CreateWindow("Test 2", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN);
SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);
It will only work this function: SDL_RenderPresent(renderer);
What are the differences in performance (example1 vs example2)?
2. For the old version SDL1.2, I often used this code: SDL_BlitSurface(SDL_GetVideoSurface(), dstsf, ...).
Do I understand correctly that the new version should use this code:
SDL_CreateTextureFromSurface(renderer, SDL_GetWindowSurface(window)); + SDL_SetRenderTarget + SDL_RenderCopy?
3. SDL_CreateWindowAndRenderer - What type of rendering will be created (software or accelerated)?
Thanks you!