Namespace the object creation properties

Fixes https://github.com/libsdl-org/SDL/issues/10543
This commit is contained in:
Sam Lantinga
2024-08-15 12:24:19 -07:00
parent 8e99ec34bb
commit d7b027a241
7 changed files with 85 additions and 85 deletions

View File

@@ -1333,7 +1333,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
textureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
}
if (GetTextureProperty(create_props, "d3d11.texture", &textureData->mainTexture) < 0) {
if (GetTextureProperty(create_props, SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER, &textureData->mainTexture) < 0) {
return -1;
}
if (!textureData->mainTexture) {
@@ -1354,7 +1354,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
textureDesc.Width = (textureDesc.Width + 1) / 2;
textureDesc.Height = (textureDesc.Height + 1) / 2;
if (GetTextureProperty(create_props, "d3d11.texture_u", &textureData->mainTextureU) < 0) {
if (GetTextureProperty(create_props, SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER, &textureData->mainTextureU) < 0) {
return -1;
}
if (!textureData->mainTextureU) {
@@ -1368,7 +1368,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
}
SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTER, textureData->mainTextureU);
if (GetTextureProperty(create_props, "d3d11.texture_v", &textureData->mainTextureV) < 0) {
if (GetTextureProperty(create_props, SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER, &textureData->mainTextureV) < 0) {
return -1;
}
if (!textureData->mainTextureV) {

View File

@@ -1613,7 +1613,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
heapProps.CreationNodeMask = 1;
heapProps.VisibleNodeMask = 1;
if (GetTextureProperty(create_props, "d3d12.texture", &textureData->mainTexture) < 0) {
if (GetTextureProperty(create_props, SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER, &textureData->mainTexture) < 0) {
return -1;
}
if (!textureData->mainTexture) {
@@ -1639,7 +1639,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
textureDesc.Width = (textureDesc.Width + 1) / 2;
textureDesc.Height = (textureDesc.Height + 1) / 2;
if (GetTextureProperty(create_props, "d3d12.texture_u", &textureData->mainTextureU) < 0) {
if (GetTextureProperty(create_props, SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER, &textureData->mainTextureU) < 0) {
return -1;
}
if (!textureData->mainTextureU) {
@@ -1658,7 +1658,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
textureData->mainResourceStateU = D3D12_RESOURCE_STATE_COPY_DEST;
SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTER, textureData->mainTextureU);
if (GetTextureProperty(create_props, "d3d12.texture_v", &textureData->mainTextureV) < 0) {
if (GetTextureProperty(create_props, SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER, &textureData->mainTextureV) < 0) {
return -1;
}
if (!textureData->mainTextureV) {

View File

@@ -1369,7 +1369,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, r.y);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, r.w);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, r.h);
SDL_SetNumberProperty(props, "flags", state->window_flags);
SDL_SetNumberProperty(props, "SDL.window.create.flags", state->window_flags);
state->windows[i] = SDL_CreateWindowWithProperties(props);
SDL_DestroyProperties(props);
if (!state->windows[i]) {

View File

@@ -2232,7 +2232,7 @@ static struct {
static SDL_WindowFlags SDL_GetWindowFlagProperties(SDL_PropertiesID props)
{
unsigned i;
SDL_WindowFlags flags = (SDL_WindowFlags)SDL_GetNumberProperty(props, "flags", 0);
SDL_WindowFlags flags = (SDL_WindowFlags)SDL_GetNumberProperty(props, "SDL.window.create.flags", 0);
for (i = 0; i < SDL_arraysize(SDL_WindowFlagProperties); ++i) {
if (SDL_WindowFlagProperties[i].invert_value) {
@@ -2486,7 +2486,7 @@ SDL_Window *SDL_CreateWindow(const char *title, int w, int h, SDL_WindowFlags fl
}
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, w);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, h);
SDL_SetNumberProperty(props, "flags", flags);
SDL_SetNumberProperty(props, "SDL.window.create.flags", flags);
window = SDL_CreateWindowWithProperties(props);
SDL_DestroyProperties(props);
return window;
@@ -2508,7 +2508,7 @@ SDL_Window *SDL_CreatePopupWindow(SDL_Window *parent, int offset_x, int offset_y
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, offset_y);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, w);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, h);
SDL_SetNumberProperty(props, "flags", flags);
SDL_SetNumberProperty(props, "SDL.window.create.flags", flags);
window = SDL_CreateWindowWithProperties(props);
SDL_DestroyProperties(props);
return window;