mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-27 15:09:11 +00:00
SDL_CreateTexture() uses the SDL_TextureAccess type for the access parameter
This commit is contained in:
parent
b0713a7d30
commit
c4bf5f9f59
5 changed files with 6 additions and 6 deletions
|
@ -500,7 +500,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *ren
|
|||
* \sa SDL_GetTextureSize
|
||||
* \sa SDL_UpdateTexture
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, int access, int w, int h);
|
||||
extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, SDL_TextureAccess access, int w, int h);
|
||||
|
||||
/**
|
||||
* Create a texture from an existing surface.
|
||||
|
|
|
@ -123,7 +123,7 @@ SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurface,(int a, int b, SDL_PixelFormat c)
|
|||
SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurfaceFrom,(int a, int b, SDL_PixelFormat c, void *d, int e),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(SDL_Palette*,SDL_CreateSurfacePalette,(SDL_Surface *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Cursor*,SDL_CreateSystemCursor,(SDL_SystemCursor a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTexture,(SDL_Renderer *a, SDL_PixelFormat b, int c, int d, int e),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTexture,(SDL_Renderer *a, SDL_PixelFormat b, SDL_TextureAccess c, int d, int e),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTextureFromSurface,(SDL_Renderer *a, SDL_Surface *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTextureWithProperties,(SDL_Renderer *a, SDL_PropertiesID b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadRuntime,(SDL_ThreadFunction a, const char *b, void *c, SDL_FunctionPointer d, SDL_FunctionPointer e),(a,b,c,d,e),return)
|
||||
|
|
|
@ -1324,7 +1324,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert
|
|||
{
|
||||
SDL_Texture *texture;
|
||||
SDL_PixelFormat format = (SDL_PixelFormat)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER, SDL_PIXELFORMAT_UNKNOWN);
|
||||
int access = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER, SDL_TEXTUREACCESS_STATIC);
|
||||
SDL_TextureAccess access = (SDL_TextureAccess)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER, SDL_TEXTUREACCESS_STATIC);
|
||||
int w = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER, 0);
|
||||
int h = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER, 0);
|
||||
SDL_Colorspace default_colorspace;
|
||||
|
@ -1478,7 +1478,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert
|
|||
return texture;
|
||||
}
|
||||
|
||||
SDL_Texture *SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, int access, int w, int h)
|
||||
SDL_Texture *SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, SDL_TextureAccess access, int w, int h)
|
||||
{
|
||||
SDL_Texture *texture;
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
|
|
|
@ -73,7 +73,7 @@ struct SDL_Texture
|
|||
float SDR_white_point; /**< The SDR white point for this content */
|
||||
float HDR_headroom; /**< The HDR headroom needed by this content */
|
||||
SDL_PixelFormat format; /**< The pixel format of the texture */
|
||||
int access; /**< SDL_TextureAccess */
|
||||
SDL_TextureAccess access; /**< The texture access mode */
|
||||
int w; /**< The width of the texture */
|
||||
int h; /**< The height of the texture */
|
||||
SDL_BlendMode blendMode; /**< The texture blend mode */
|
||||
|
|
|
@ -515,7 +515,7 @@ static int PSP_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_P
|
|||
|
||||
psp_texture->pitch = psp_texture->textureWidth * SDL_BYTESPERPIXEL(texture->format);
|
||||
psp_texture->size = psp_texture->textureHeight * psp_texture->pitch;
|
||||
if (texture->access & SDL_TEXTUREACCESS_TARGET) {
|
||||
if (texture->access == SDL_TEXTUREACCESS_TARGET) {
|
||||
if (TextureSpillTargetsForSpace(renderer->internal, psp_texture->size) < 0) {
|
||||
SDL_free(psp_texture);
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue