Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
hw3d
Commits
51a0c50e
Commit
51a0c50e
authored
Aug 27, 2019
by
chili
Browse files
create bindable for dual vtx/pxl transform binding
parent
b4c37cb8
Changes
4
Hide whitespace changes
Inline
Side-by-side
hw3d/TransformCbufDoubleboi.cpp
0 → 100644
View file @
51a0c50e
#include "TransformCbufDoubleboi.h"
namespace
Bind
{
TransformCbufDoubleboi
::
TransformCbufDoubleboi
(
Graphics
&
gfx
,
const
Drawable
&
parent
,
UINT
slotV
,
UINT
slotP
)
:
TransformCbuf
(
gfx
,
parent
,
slotV
)
{
if
(
!
pPcbuf
)
{
pPcbuf
=
std
::
make_unique
<
PixelConstantBuffer
<
Transforms
>>
(
gfx
,
slotP
);
}
}
void
Bind
::
TransformCbufDoubleboi
::
Bind
(
Graphics
&
gfx
)
noexcept
{
const
auto
tf
=
GetTransforms
(
gfx
);
TransformCbuf
::
UpdateBindImpl
(
gfx
,
tf
);
UpdateBindImpl
(
gfx
,
tf
);
}
void
TransformCbufDoubleboi
::
UpdateBindImpl
(
Graphics
&
gfx
,
const
Transforms
&
tf
)
noexcept
{
pPcbuf
->
Update
(
gfx
,
tf
);
pPcbuf
->
Bind
(
gfx
);
}
std
::
unique_ptr
<
PixelConstantBuffer
<
TransformCbuf
::
Transforms
>>
TransformCbufDoubleboi
::
pPcbuf
;
}
\ No newline at end of file
hw3d/TransformCbufDoubleboi.h
0 → 100644
View file @
51a0c50e
#pragma once
#include "TransformCbuf.h"
namespace
Bind
{
class
TransformCbufDoubleboi
:
public
TransformCbuf
{
public:
TransformCbufDoubleboi
(
Graphics
&
gfx
,
const
Drawable
&
parent
,
UINT
slotV
=
0u
,
UINT
slotP
=
0u
);
void
Bind
(
Graphics
&
gfx
)
noexcept
override
;
protected:
void
UpdateBindImpl
(
Graphics
&
gfx
,
const
Transforms
&
tf
)
noexcept
;
private:
static
std
::
unique_ptr
<
PixelConstantBuffer
<
Transforms
>>
pPcbuf
;
};
}
\ No newline at end of file
hw3d/hw3d.vcxproj
View file @
51a0c50e
...
...
@@ -122,6 +122,7 @@
<ClCompile
Include=
"Texture.cpp"
/>
<ClCompile
Include=
"Topology.cpp"
/>
<ClCompile
Include=
"TransformCbuf.cpp"
/>
<ClCompile
Include=
"TransformCbufDoubleboi.cpp"
/>
<ClCompile
Include=
"Vertex.cpp"
/>
<ClCompile
Include=
"VertexBuffer.cpp"
/>
<ClCompile
Include=
"VertexShader.cpp"
/>
...
...
@@ -175,6 +176,7 @@
<ClInclude
Include=
"Texture.h"
/>
<ClInclude
Include=
"Topology.h"
/>
<ClInclude
Include=
"TransformCbuf.h"
/>
<ClInclude
Include=
"TransformCbufDoubleboi.h"
/>
<ClInclude
Include=
"Vertex.h"
/>
<ClInclude
Include=
"VertexBuffer.h"
/>
<ClInclude
Include=
"VertexShader.h"
/>
...
...
hw3d/hw3d.vcxproj.filters
View file @
51a0c50e
...
...
@@ -153,6 +153,9 @@
<ClCompile
Include=
"TestPlane.cpp"
>
<Filter>
Source Files\Drawable
</Filter>
</ClCompile>
<ClCompile
Include=
"TransformCbufDoubleboi.cpp"
>
<Filter>
Source Files\Bindable
</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"WindowsMessageMap.h"
>
...
...
@@ -308,6 +311,9 @@
<ClInclude
Include=
"TestPlane.h"
>
<Filter>
Header Files\Drawable
</Filter>
</ClInclude>
<ClInclude
Include=
"TransformCbufDoubleboi.h"
>
<Filter>
Header Files\Bindable
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile
Include=
"hw3d.rc"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment