1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 #include "Direct3D8.hpp"
24 HINSTANCE dllInstance;
26 int __stdcall DllMain(HINSTANCE instance, unsigned long reason, void *reserved)
28 dllInstance = instance;
32 case DLL_PROCESS_DETACH:
34 case DLL_PROCESS_ATTACH:
35 DisableThreadLibraryCalls(instance);
37 case DLL_THREAD_ATTACH:
39 case DLL_THREAD_DETACH:
42 SetLastError(ERROR_INVALID_PARAMETER);
49 IDirect3D8 *__stdcall Direct3DCreate8(unsigned int version)
51 // D3D_SDK_VERSION check
52 if(version != 120 && // 8.0
53 version != 220) // 8.1
59 FILE *file = fopen("debug.txt", "w"); // Clear debug log
63 IDirect3D8 *device = new D3D8::Direct3D8(version, dllInstance);
73 int __stdcall CheckFullscreen() // FIXME: __cdecl or __stdcall?
76 // ASSERT(false); // FIXME
82 void __cdecl DebugSetMute(long mute) // FIXME: Return type
84 // ASSERT(false); // FIXME
87 int __stdcall ValidatePixelShader(long *shader, int x, int y, int z) // FIXME: __cdecl or __stdcall? // FIXME: Argument meanings
89 // ASSERT(false); // FIXME
94 int __stdcall ValidateVertexShader(long *shader, int x, int y, int z) // FIXME: __cdecl or __stdcall? // FIXME: Argument meanings
96 // ASSERT(false); // FIXME