Skip to content

Commit

Permalink
SDL_CreateTexture() uses the SDL_TextureAccess type for the access pa…
Browse files Browse the repository at this point in the history
…rameter
  • Loading branch information
slouken committed Jul 22, 2024
1 parent 70c1012 commit ef03a05
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/SDL3/SDL_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/dynapi/SDL_dynapi_procs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/render/SDL_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/render/SDL_sysrender.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/render/psp/SDL_render_psp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ef03a05

Please sign in to comment.