Emphasized the separation between SDL_Surface and SDL_Texture
- SDL_Surface is a system memory representation of pixel data - SDL_Texture is a video memory representation of pixel data The concept of SDL_Surface with SDL_HWSURFACE is no longer used. Separated SDL_Texture types by usage rather than memory type - SDL_TEXTUREACCESS_STATIC is for rarely changed pixel data, can be placed in video memory. - SDL_TEXTUREACCESS_STREAMING is for frequently changing pixel data, usually placed in system memory or AGP memory. Optimized the SDL_compat usage of the OpenGL renderer by only using one copy of the framebuffer instead of two. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402584
This commit is contained in:
parent
c1a200fa1d
commit
6b348f07c7
11 changed files with 203 additions and 291 deletions
|
@ -459,7 +459,6 @@ D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
SDL_Window *window = SDL_GetWindowFromID(renderer->window);
|
||||
SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
|
||||
D3D_TextureData *data;
|
||||
D3DPOOL pool;
|
||||
HRESULT result;
|
||||
|
||||
data = (D3D_TextureData *) SDL_calloc(1, sizeof(*data));
|
||||
|
@ -470,22 +469,11 @@ D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
|
||||
texture->driverdata = data;
|
||||
|
||||
#if 1
|
||||
/* FIXME: Do we want non-managed textures?
|
||||
They need to be freed on device reset and then reloaded by the app...
|
||||
*/
|
||||
texture->access = SDL_TEXTUREACCESS_LOCAL;
|
||||
#endif
|
||||
if (texture->access == SDL_TEXTUREACCESS_LOCAL) {
|
||||
pool = D3DPOOL_MANAGED;
|
||||
} else {
|
||||
pool = D3DPOOL_DEFAULT;
|
||||
}
|
||||
result =
|
||||
IDirect3DDevice9_CreateTexture(renderdata->device, texture->w,
|
||||
texture->h, 1, 0,
|
||||
PixelFormatToD3DFMT(texture->format),
|
||||
pool, &data->texture, NULL);
|
||||
D3DPOOL_MANAGED, &data->texture, NULL);
|
||||
if (FAILED(result)) {
|
||||
D3D_SetError("CreateTexture()", result);
|
||||
return -1;
|
||||
|
@ -628,11 +616,6 @@ D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||
D3DLOCKED_RECT locked;
|
||||
HRESULT result;
|
||||
|
||||
if (texture->access != SDL_TEXTUREACCESS_LOCAL) {
|
||||
SDL_SetError("Can't lock remote video memory");
|
||||
return -1;
|
||||
}
|
||||
|
||||
d3drect.left = rect->x;
|
||||
d3drect.right = rect->x + rect->w;
|
||||
d3drect.top = rect->y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue