Rise
The Vieneo Province
Toggle main menu visibility
Loading...
Searching...
No Matches
Sprite11.h
Go to the documentation of this file.
1
#pragma once
2
#include "
FixedFunction11.h
"
3
#include <d3d11_1.h>
4
namespace
Rendering
5
{
6
enum class
SpriteSort11
{
Deferred
,
Texture
,
FrontToBack
,
BackToFront
};
7
struct
SpriteOptions11
{
bool
alphaBlend
=
true
;
SpriteSort11
sort
=
SpriteSort11::Deferred
;
bool
sortTextures
=
false
;
bool
inheritBlend
=
false
;};
8
class
Sprite11
9
{
10
public
:
11
using
Vector
=DirectX::XMFLOAT3;
12
using
Matrix
=DirectX::XMFLOAT4X4;
13
HRESULT
Initialize
(ID3D11Device*
device
,
const
std::filesystem::path& shaderDirectory={});
14
HRESULT
Begin
(ID3D11DeviceContext*
context
,
const
SpriteOptions11
&
options
={});
15
HRESULT
Draw
(ID3D11ShaderResourceView* texture,
const
RECT* source=
nullptr
,
16
const
Vector
* center=
nullptr
,
const
Vector
* position=
nullptr
,uint32_t color=0xffffffff);
17
HRESULT
Flush
();
18
HRESULT
End
();
19
HRESULT
SetScissor
(
bool
enabled,
const
RECT& rectangle);
20
D3D11_SAMPLER_DESC&
Sampler
(){
return
state
.
stages
[0].sampler;}
21
void
SetTransform
(
const
Matrix
& value) {
transform
=value;}
22
const
Matrix
&
Transform
()
const
{
return
transform
;}
23
void
Reset
();
24
~Sprite11
(){
Reset
();}
25
const
std::string&
Status
()
const
{
return
status
;}
26
private
:
27
static
constexpr
UINT
Capacity
=1024;
28
struct
Entry
29
{
30
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>
texture
;
31
std::array<FixedVertex11,4>
vertices
;
32
float
depth
=0;
33
};
34
void
Restore
();
35
Microsoft::WRL::ComPtr<ID3D11Device>
device
;
36
Microsoft::WRL::ComPtr<ID3D11DeviceContext1>
context
;
37
Microsoft::WRL::ComPtr<ID3DDeviceContextState>
isolated
,
previous
;
38
Microsoft::WRL::ComPtr<ID3D11Buffer>
vertices
,
indices
;
39
Microsoft::WRL::ComPtr<ID3D11RasterizerState>
batchRaster
;
40
Microsoft::WRL::ComPtr<ID3D11DepthStencilState>
batchDepth
;
41
Microsoft::WRL::ComPtr<ID3D11BlendState>
batchBlend
;
42
FLOAT
batchBlendFactor
[4]{};
43
UINT
batchSampleMask
=UINT_MAX,
batchStencilReference
=0;
44
FixedFunction11
fixed
;
45
FixedState11
state
;
46
SpriteOptions11
options
;
47
Matrix
transform
{};
48
std::vector<Entry>
queue
;
49
// Sort compact indices; keep the 264-byte sprite entries stationary.
50
std::vector<size_t>
order
;
51
// Consecutive map tiles share an immutable SRV description. Retain the
52
// view while cached so a released object's address cannot be reused.
53
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>
sizeTexture
;
54
UINT
textureWidth
=0,
textureHeight
=0;
55
std::string
status
;
56
};
57
}
HRESULT
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
FixedFunction11.h
Rendering::FixedFunction11
Definition
FixedFunction11.h:87
Rendering::Sprite11
Definition
Sprite11.h:9
Rendering::Sprite11::fixed
FixedFunction11 fixed
Definition
Sprite11.h:44
Rendering::Sprite11::batchStencilReference
UINT batchStencilReference
Definition
Sprite11.h:43
Rendering::Sprite11::batchSampleMask
UINT batchSampleMask
Definition
Sprite11.h:43
Rendering::Sprite11::batchDepth
Microsoft::WRL::ComPtr< ID3D11DepthStencilState > batchDepth
Definition
Sprite11.h:40
Rendering::Sprite11::~Sprite11
~Sprite11()
Definition
Sprite11.h:24
Rendering::Sprite11::transform
Matrix transform
Definition
Sprite11.h:47
Rendering::Sprite11::Vector
DirectX::XMFLOAT3 Vector
Definition
Sprite11.h:11
Rendering::Sprite11::Initialize
HRESULT Initialize(ID3D11Device *device, const std::filesystem::path &shaderDirectory={})
Definition
Sprite11.cpp:26
Rendering::Sprite11::Transform
const Matrix & Transform() const
Definition
Sprite11.h:22
Rendering::Sprite11::Status
const std::string & Status() const
Definition
Sprite11.h:25
Rendering::Sprite11::End
HRESULT End()
Definition
Sprite11.cpp:206
Rendering::Sprite11::SetTransform
void SetTransform(const Matrix &value)
Definition
Sprite11.h:21
Rendering::Sprite11::Reset
void Reset()
Definition
Sprite11.cpp:21
Rendering::Sprite11::Sampler
D3D11_SAMPLER_DESC & Sampler()
Definition
Sprite11.h:20
Rendering::Sprite11::Draw
HRESULT Draw(ID3D11ShaderResourceView *texture, const RECT *source=nullptr, const Vector *center=nullptr, const Vector *position=nullptr, uint32_t color=0xffffffff)
Definition
Sprite11.cpp:100
Rendering::Sprite11::sizeTexture
Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > sizeTexture
Definition
Sprite11.h:53
Rendering::Sprite11::batchBlendFactor
FLOAT batchBlendFactor[4]
Definition
Sprite11.h:42
Rendering::Sprite11::Flush
HRESULT Flush()
Definition
Sprite11.cpp:146
Rendering::Sprite11::textureHeight
UINT textureHeight
Definition
Sprite11.h:54
Rendering::Sprite11::Matrix
DirectX::XMFLOAT4X4 Matrix
Definition
Sprite11.h:12
Rendering::Sprite11::SetScissor
HRESULT SetScissor(bool enabled, const RECT &rectangle)
Definition
Sprite11.cpp:135
Rendering::Sprite11::options
SpriteOptions11 options
Definition
Sprite11.h:46
Rendering::Sprite11::batchRaster
Microsoft::WRL::ComPtr< ID3D11RasterizerState > batchRaster
Definition
Sprite11.h:39
Rendering::Sprite11::batchBlend
Microsoft::WRL::ComPtr< ID3D11BlendState > batchBlend
Definition
Sprite11.h:41
Rendering::Sprite11::vertices
Microsoft::WRL::ComPtr< ID3D11Buffer > vertices
Definition
Sprite11.h:38
Rendering::Sprite11::queue
std::vector< Entry > queue
Definition
Sprite11.h:48
Rendering::Sprite11::isolated
Microsoft::WRL::ComPtr< ID3DDeviceContextState > isolated
Definition
Sprite11.h:37
Rendering::Sprite11::indices
Microsoft::WRL::ComPtr< ID3D11Buffer > indices
Definition
Sprite11.h:38
Rendering::Sprite11::Capacity
static constexpr UINT Capacity
Definition
Sprite11.h:27
Rendering::Sprite11::order
std::vector< size_t > order
Definition
Sprite11.h:50
Rendering::Sprite11::Begin
HRESULT Begin(ID3D11DeviceContext *context, const SpriteOptions11 &options={})
Definition
Sprite11.cpp:47
Rendering::Sprite11::device
Microsoft::WRL::ComPtr< ID3D11Device > device
Definition
Sprite11.h:35
Rendering::Sprite11::textureWidth
UINT textureWidth
Definition
Sprite11.h:54
Rendering::Sprite11::state
FixedState11 state
Definition
Sprite11.h:45
Rendering::Sprite11::context
Microsoft::WRL::ComPtr< ID3D11DeviceContext1 > context
Definition
Sprite11.h:36
Rendering::Sprite11::status
std::string status
Definition
Sprite11.h:55
Rendering::Sprite11::previous
Microsoft::WRL::ComPtr< ID3DDeviceContextState > previous
Definition
Sprite11.h:37
Rendering
Definition
AdDiagnostics11.cpp:16
Rendering::TextureArg11::Texture
@ Texture
Definition
FixedFunction11.h:22
Rendering::SpriteSort11
SpriteSort11
Definition
Sprite11.h:6
Rendering::SpriteSort11::FrontToBack
@ FrontToBack
Definition
Sprite11.h:6
Rendering::SpriteSort11::Deferred
@ Deferred
Definition
Sprite11.h:6
Rendering::SpriteSort11::BackToFront
@ BackToFront
Definition
Sprite11.h:6
Restore
Model.
Rendering::FixedState11
Definition
FixedFunction11.h:48
Rendering::FixedState11::stages
std::array< TextureStage11, 8 > stages
Definition
FixedFunction11.h:80
Rendering::Sprite11::Entry
Definition
Sprite11.h:29
Rendering::Sprite11::Entry::vertices
std::array< FixedVertex11, 4 > vertices
Definition
Sprite11.h:31
Rendering::Sprite11::Entry::depth
float depth
Definition
Sprite11.h:32
Rendering::Sprite11::Entry::texture
Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > texture
Definition
Sprite11.h:30
Rendering::SpriteOptions11
Definition
Sprite11.h:7
Rendering::SpriteOptions11::alphaBlend
bool alphaBlend
Definition
Sprite11.h:7
Rendering::SpriteOptions11::inheritBlend
bool inheritBlend
Definition
Sprite11.h:7
Rendering::SpriteOptions11::sortTextures
bool sortTextures
Definition
Sprite11.h:7
Rendering::SpriteOptions11::sort
SpriteSort11 sort
Definition
Sprite11.h:7
Rendering
Sprite11.h
Generated on
for Rise by
1.18.0