2002-12-17 02:15:15 +01:00
|
|
|
/*
|
|
|
|
* Direct3D X 8 main file
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Raphael Junqueira
|
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-12-17 02:15:15 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "wine/port.h"
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2002-12-17 02:15:15 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "wine/debug.h"
|
2007-12-05 08:44:22 +01:00
|
|
|
#include "wine/unicode.h"
|
2007-12-17 23:08:16 +01:00
|
|
|
#include "d3dx8_private.h"
|
2002-12-17 02:15:15 +01:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
|
|
|
|
2003-01-02 20:28:09 +01:00
|
|
|
HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer) {
|
2002-12-17 02:15:15 +01:00
|
|
|
ID3DXBufferImpl *object;
|
|
|
|
|
|
|
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXBufferImpl));
|
|
|
|
if (NULL == object) {
|
|
|
|
*ppBuffer = (LPD3DXBUFFER)NULL;
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
object->lpVtbl = &D3DXBuffer_Vtbl;
|
|
|
|
object->ref = 1;
|
|
|
|
object->bufferSize = NumBytes;
|
|
|
|
object->buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, NumBytes);
|
|
|
|
if (NULL == object->buffer) {
|
|
|
|
HeapFree(GetProcessHeap(), 0, object);
|
|
|
|
*ppBuffer = (LPD3DXBUFFER)NULL;
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
*ppBuffer = (LPD3DXBUFFER)object;
|
|
|
|
return D3D_OK;
|
|
|
|
}
|
|
|
|
|
2003-01-02 20:28:09 +01:00
|
|
|
HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont) {
|
2002-12-17 02:15:15 +01:00
|
|
|
FIXME("(void): stub\n");
|
|
|
|
return D3D_OK;
|
|
|
|
}
|
|
|
|
|
2003-01-02 20:28:09 +01:00
|
|
|
UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF) {
|
2002-12-17 02:15:15 +01:00
|
|
|
FIXME("(void): stub\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-01-02 20:28:09 +01:00
|
|
|
HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags,
|
2002-12-17 02:15:15 +01:00
|
|
|
LPD3DXBUFFER* ppConstants,
|
|
|
|
LPD3DXBUFFER* ppCompiledShader,
|
|
|
|
LPD3DXBUFFER* ppCompilationErrors) {
|
|
|
|
FIXME("(void): stub\n");
|
|
|
|
return D3D_OK;
|
|
|
|
}
|
|
|
|
|
2003-01-02 20:28:09 +01:00
|
|
|
HRESULT WINAPI D3DXAssembleShaderFromFileA(LPSTR pSrcFile, DWORD Flags,
|
2002-12-17 02:15:15 +01:00
|
|
|
LPD3DXBUFFER* ppConstants,
|
|
|
|
LPD3DXBUFFER* ppCompiledShader,
|
|
|
|
LPD3DXBUFFER* ppCompilationErrors) {
|
2007-12-05 08:44:22 +01:00
|
|
|
LPWSTR pSrcFileW = NULL;
|
|
|
|
DWORD len;
|
|
|
|
HRESULT ret;
|
|
|
|
|
|
|
|
if (!pSrcFile) return D3DXERR_INVALIDDATA;
|
|
|
|
|
|
|
|
len = MultiByteToWideChar( CP_ACP, 0, pSrcFile, -1, NULL, 0 );
|
|
|
|
pSrcFileW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
|
|
|
|
MultiByteToWideChar( CP_ACP, 0, pSrcFile, -1, pSrcFileW, len );
|
|
|
|
ret=D3DXAssembleShaderFromFileW(pSrcFileW, Flags, ppConstants, ppCompiledShader, ppCompilationErrors);
|
|
|
|
HeapFree( GetProcessHeap(), 0, pSrcFileW );
|
|
|
|
return ret;
|
2002-12-17 02:15:15 +01:00
|
|
|
}
|
|
|
|
|
2007-12-05 08:44:22 +01:00
|
|
|
HRESULT WINAPI D3DXAssembleShaderFromFileW(LPWSTR pSrcFile, DWORD Flags,
|
2002-12-17 02:15:15 +01:00
|
|
|
LPD3DXBUFFER* ppConstants,
|
|
|
|
LPD3DXBUFFER* ppCompiledShader,
|
|
|
|
LPD3DXBUFFER* ppCompilationErrors) {
|
|
|
|
FIXME("(void): stub\n");
|
|
|
|
return D3D_OK;
|
|
|
|
}
|
2007-10-04 09:50:36 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllMain.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
|
|
|
|
{
|
|
|
|
switch(reason)
|
|
|
|
{
|
|
|
|
case DLL_WINE_PREATTACH:
|
|
|
|
return FALSE; /* prefer native version */
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(inst);
|
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|