|
OpenTTD Source 20261112-master-gbcbec5e63f
|
Implementation of the Windows (Direct3D 11) video driver. More...
#include "../stdafx.h"#include "../openttd.h"#include "../error_func.h"#include "../os/windows/win32.h"#include "../blitter/factory.hpp"#include "../core/geometry_func.hpp"#include "../window_func.h"#include "../framerate_type.h"#include "../library_loader.h"#include "../table/hlsl_shader.h"#include "win32_v.h"#include <windows.h>#include <objbase.h>#include <wrl/client.h>#include <dxgi1_5.h>#include <d3d11.h>#include <d3dcompiler.h>#include "../safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | HlslConstantBuffer |
| Structure for an HLSL constant buffer containing the sprite position, screen size, zoom level, and flags for RGB and crash mode. More... | |
| class | VideoDriver_Win32D3D11 |
| The D3D11 video driver for windows. More... | |
| class | FVideoDriver_Win32D3D11 |
| The factory for Windows' D3D11 video driver. More... | |
Functions | |
| static std::string_view | CompileShader (std::string_view source, std::string_view func, std::string_view profile, ComPtr< ID3DBlob > &code) |
| Compiles an HLSL shader from source code. | |
| static std::string_view | CreateVertexShader (ID3D11Device *device, std::string_view source, ComPtr< ID3D11VertexShader > &shader) |
| Creates a vertex shader from HLSL source code. | |
| static std::string_view | CreatePixelShader (ID3D11Device *device, std::string_view source, ComPtr< ID3D11PixelShader > &shader) |
| Creates a pixel shader from HLSL source code. | |
Variables | |
| bool | _window_maximize |
| Declared in win32_v.cpp. | |
| static LibraryLoader | _d3d11 ("d3d11.dll") |
| LibraryLoader instance for the D3D11 DLL. | |
| static std::unique_ptr< LibraryLoader > | _d3dcompiler |
| Pointer to a LibraryLoader instance for the D3DCompiler DLL. | |
| static PFN_D3D11_CREATE_DEVICE | _D3D11CreateDevice |
| Pointer to the D3D11CreateDevice function. | |
| static pD3DCompile | _D3DCompile |
| Pointer to the D3DCompile function. | |
| static FVideoDriver_Win32D3D11 | iFVideoDriver_Win32D3D11 |
| Factory instance for the D3D11 video driver. | |
Implementation of the Windows (Direct3D 11) video driver.
Definition in file d3d11_v.cpp.
|
static |
Compiles an HLSL shader from source code.
| source | The HLSL source code. |
| func | The entry point function name. |
| profile | The shader profile (e.g., "vs_4_0" for vertex shader, "ps_4_0" for pixel shader). |
| code | A reference to a ComPtr that will hold the compiled shader object. |
Definition at line 61 of file d3d11_v.cpp.
References _D3DCompile, Debug, Driver, and Error.
Referenced by CreatePixelShader(), and CreateVertexShader().
|
static |
Creates a pixel shader from HLSL source code.
| device | The D3D11 device. |
| source | The HLSL source code. |
| shader | A reference to a ComPtr that will hold the created pixel shader. |
Definition at line 106 of file d3d11_v.cpp.
References CompileShader().
Referenced by VideoDriver_Win32D3D11::InitD3D().
|
static |
Creates a vertex shader from HLSL source code.
| device | The D3D11 device. |
| source | The HLSL source code. |
| shader | A reference to a ComPtr that will hold the created vertex shader. |
Definition at line 85 of file d3d11_v.cpp.
References CompileShader().
Referenced by VideoDriver_Win32D3D11::InitD3D().
|
static |
Pointer to the D3D11CreateDevice function.
Definition at line 49 of file d3d11_v.cpp.
Referenced by VideoDriver_Win32D3D11::InitD3D(), VideoDriver_Win32D3D11::Start(), and VideoDriver_Win32D3D11::Stop().
|
static |
Pointer to the D3DCompile function.
Definition at line 50 of file d3d11_v.cpp.
Referenced by CompileShader(), VideoDriver_Win32D3D11::Start(), and VideoDriver_Win32D3D11::Stop().
|
static |
Pointer to a LibraryLoader instance for the D3DCompiler DLL.
Definition at line 47 of file d3d11_v.cpp.
Referenced by VideoDriver_Win32D3D11::Start().
|
extern |
Declared in win32_v.cpp.
Definition at line 58 of file win32_v.cpp.
Referenced by VideoDriver_Win32Base::ChangeResolution(), VideoDriver_Win32D3D11::ChangeResolution(), and VideoDriver_Win32Base::MakeWindow().
|
static |
Factory instance for the D3D11 video driver.
Definition at line 240 of file d3d11_v.cpp.