mirror of
https://github.com/yawut/SDL.git
synced 2026-04-25 15:58:04 -05:00
render/wiiu: Fix resource flags on texture creation
This commit is contained in:
parent
72d34778d6
commit
e147fbab72
|
|
@ -73,7 +73,9 @@ int WIIU_SDL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
/* Allocate the texture's surface */
|
/* Allocate the texture's surface */
|
||||||
res = GX2RCreateSurface(
|
res = GX2RCreateSurface(
|
||||||
&tdata->texture.surface,
|
&tdata->texture.surface,
|
||||||
GX2R_RESOURCE_BIND_TEXTURE | GX2R_RESOURCE_BIND_COLOR_BUFFER
|
GX2R_RESOURCE_BIND_TEXTURE | GX2R_RESOURCE_BIND_COLOR_BUFFER |
|
||||||
|
GX2R_RESOURCE_USAGE_CPU_WRITE | GX2R_RESOURCE_USAGE_CPU_READ |
|
||||||
|
GX2R_RESOURCE_USAGE_GPU_WRITE | GX2R_RESOURCE_USAGE_GPU_READ
|
||||||
);
|
);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
SDL_free(tdata);
|
SDL_free(tdata);
|
||||||
|
|
@ -102,11 +104,7 @@ int WIIU_SDL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||||
Uint32 BytesPerPixel = SDL_BYTESPERPIXEL(texture->format);
|
Uint32 BytesPerPixel = SDL_BYTESPERPIXEL(texture->format);
|
||||||
void* pixel_buffer;
|
void* pixel_buffer;
|
||||||
|
|
||||||
pixel_buffer = GX2RLockSurfaceEx(
|
pixel_buffer = GX2RLockSurfaceEx(&tdata->texture.surface, 0, 0);
|
||||||
&tdata->texture.surface,
|
|
||||||
0, //mipmap level?
|
|
||||||
GX2R_RESOURCE_USAGE_CPU_READ | GX2R_RESOURCE_USAGE_CPU_WRITE
|
|
||||||
);
|
|
||||||
if (!pixel_buffer) {
|
if (!pixel_buffer) {
|
||||||
//TODO real error handling
|
//TODO real error handling
|
||||||
printf("SDL: Couldn't lock surface for texture!\n");
|
printf("SDL: Couldn't lock surface for texture!\n");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user