From 0951a1b6db1ed219058f82c330e22d9d9bfc8516 Mon Sep 17 00:00:00 2001 From: Andrey Gusev Date: Fri, 4 Nov 2016 15:43:21 +0100 Subject: [PATCH] d3dx11: Add D3DX11SaveTextureToMemory stub. Signed-off-by: Andrey Gusev Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- dlls/d3dx11_42/Makefile.in | 3 ++- dlls/d3dx11_42/d3dx11_42.spec | 2 +- dlls/d3dx11_43/Makefile.in | 3 ++- dlls/d3dx11_43/d3dx11_43.spec | 2 +- dlls/d3dx11_43/texture.c | 35 +++++++++++++++++++++++++++++++++++ include/d3dx11tex.h | 3 +++ 6 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 dlls/d3dx11_43/texture.c diff --git a/dlls/d3dx11_42/Makefile.in b/dlls/d3dx11_42/Makefile.in index 3ed7fd3e553..d20f6600ecd 100644 --- a/dlls/d3dx11_42/Makefile.in +++ b/dlls/d3dx11_42/Makefile.in @@ -4,6 +4,7 @@ PARENTSRC = ../d3dx11_43 C_SRCS = \ async.c \ - d3dx11_42.c + d3dx11_42.c \ + texture.c RC_SRCS = version.rc diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 45e848250b1..f97ec246bdf 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -41,4 +41,4 @@ @ stub D3DX11SHProjectCubeMap @ stub D3DX11SaveTextureToFileA @ stub D3DX11SaveTextureToFileW -@ stub D3DX11SaveTextureToMemory +@ stdcall D3DX11SaveTextureToMemory(ptr ptr long ptr long) diff --git a/dlls/d3dx11_43/Makefile.in b/dlls/d3dx11_43/Makefile.in index 1cc4911c196..d5c5b455480 100644 --- a/dlls/d3dx11_43/Makefile.in +++ b/dlls/d3dx11_43/Makefile.in @@ -4,6 +4,7 @@ IMPORTS = d3dcompiler C_SRCS = \ async.c \ - d3dx11_43.c + d3dx11_43.c \ + texture.c RC_SRCS = version.rc diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index 7c3a5982083..0a6350c4692 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -41,4 +41,4 @@ @ stub D3DX11SHProjectCubeMap @ stub D3DX11SaveTextureToFileA @ stub D3DX11SaveTextureToFileW -@ stub D3DX11SaveTextureToMemory +@ stdcall D3DX11SaveTextureToMemory(ptr ptr long ptr long) diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c new file mode 100644 index 00000000000..832f64f93c2 --- /dev/null +++ b/dlls/d3dx11_43/texture.c @@ -0,0 +1,35 @@ +/* + * Copyright 2016 Andrey Gusev + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" +#include "d3dx11.h" +#include "d3dcompiler.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3dx); + +HRESULT WINAPI D3DX11SaveTextureToMemory(ID3D11DeviceContext *context, ID3D11Resource *texture, + D3DX11_IMAGE_FILE_FORMAT format, ID3D10Blob **buffer, UINT flags) +{ + FIXME("context %p, texture %p, format %u, buffer %p, flags %#x stub!\n", + context, texture, format, buffer, flags); + + return E_NOTIMPL; +} diff --git a/include/d3dx11tex.h b/include/d3dx11tex.h index 0217777d782..bd22f32ac98 100644 --- a/include/d3dx11tex.h +++ b/include/d3dx11tex.h @@ -92,6 +92,9 @@ HRESULT WINAPI D3DX11CreateTextureFromMemory(ID3D11Device *device, const void *s HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump, D3DX11_IMAGE_INFO *img_info, HRESULT *hresult); +HRESULT WINAPI D3DX11SaveTextureToMemory(ID3D11DeviceContext *context, ID3D11Resource *texture, + D3DX11_IMAGE_FILE_FORMAT format, ID3D10Blob **buffer, UINT flags); + #ifdef __cplusplus } #endif