mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Added colorspace to SDL_CameraSpec
This commit is contained in:
parent
98499d6818
commit
aeea819494
10 changed files with 407 additions and 167 deletions
|
|
@ -274,8 +274,18 @@ int SDL_AppIterate(void *appstate)
|
|||
SDL_DestroyTexture(texture);
|
||||
}
|
||||
|
||||
SDL_Colorspace colorspace = SDL_COLORSPACE_UNKNOWN;
|
||||
SDL_GetSurfaceColorspace(frame_current, &colorspace);
|
||||
|
||||
/* Create texture with appropriate format */
|
||||
texture = SDL_CreateTexture(renderer, frame_current->format->format, SDL_TEXTUREACCESS_STREAMING, frame_current->w, frame_current->h);
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER, frame_current->format->format);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER, colorspace);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER, SDL_TEXTUREACCESS_STREAMING);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER, frame_current->w);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER, frame_current->h);
|
||||
texture = SDL_CreateTextureWithProperties(renderer, props);
|
||||
SDL_DestroyProperties(props);
|
||||
if (!texture) {
|
||||
SDL_Log("Couldn't create texture: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue