3D wrapper of ClearRenderTargetView (DirectX 10)

Recommended Posts

Posted (edited)

hi everyone :

i want the equivalent and the correct vb.NET code for the following interface memeber :

virtual void STDMETHODCALLTYPE ClearRenderTargetView(
/* [annotation] */
__in  ID3D10RenderTargetView *pRenderTargetView,
/* [annotation] */
__in  const FLOAT ColorRGBA[ 4 ]) = 0;

REMARKS:

FLOAT is float;

this declaration is from MSDN :

void ClearRenderTargetView(
[in]       ID3D10RenderTargetView *pRenderTargetView,
[in] const FLOAT                  ColorRGBA[4]
);

____________________________________________________________________________________________________________

Edited by abdellah

Share on other sites
Posted (edited)

Are you using some sort of DX10 wrapper?

edit - slimdx seems to be a dx wrapper for .net technologies.  Also IIRC there's also sharpdx

Edited by Infinisearch

Share on other sites
Posted (edited)

yes, i make my own wrapper.

Edited by abdellah

Share on other sites

which one? If so it shouldn't it have that exact function?

Share on other sites
Posted (edited)

notes :

if i use those declarations i got AccessViolationException error :

Sub ClearRenderTargetView(ByVal pRenderTargetView As ID3D10RenderTargetView,
ByVal ColorRGBA() As Single)

or :

Sub ClearRenderTargetView(ByVal pRenderTargetView As ID3D10RenderTargetView,
ByRef ColorRGBA() As Single)

or :

Sub ClearRenderTargetView(ByVal pRenderTargetView As ID3D10RenderTargetView,
ByVal ColorRGBA As Single)

or :

Sub ClearRenderTargetView(ByVal pRenderTargetView As ID3D10RenderTargetView,
ByRef ColorRGBA As Single)

but if i use the following synthax i gives me nothing (there is no return value) :

Sub ClearRenderTargetView(ByVal pRenderTargetView As ID3D10RenderTargetView,
ByVal ColorRGBA As D3DXVECTOR4)

with :

<StructLayout(LayoutKind.Sequential, Size:=4)>
Public Structure D3DXVECTOR4
Dim x, y, z, w As Single
Public Sub New(ByVal xp As Single, ByVal yp As Single, ByVal zp As Single, ByVal wp As Single)
x = xp
y = yp
z = zp
w = wp

End Sub
End Structure

but the result is :

Edited by abdellah

Share on other sites

I've never implemented a wrapper for an api before so I can't help you since you say you implemented your own.  But if I were to guess, I'd think that if clearrendertarget has a problem there are other calls that don't work as well... maybe if you track those down you can narrow down where you went wrong with your wrapper.  Another alternative might be to look at the source for slimdx or sharpdx since they are opensource.  Maybe seeing there implementation can help you with yours.

Also I'd like to say DX10 is a dead API, DX11 is DX10 done right.  In addition IIRC DX10 and DX11 are extremely similar.  So if you move to DX11 you can use slimdx or sharpdx directly which will make your life much easier.

Share on other sites

but sharpDX and slimDX hide the source (the first layer) methods and show only the wrapped one.

Share on other sites

Thats the way a wrapper works.  Besides they describe themselves as "low-level" and "lean" which hint that they are minimal wrappers.

Create an account

Register a new account

• Forum Statistics

• Total Topics
628327
• Total Posts
2982090
• Similar Content

• Hey, Im using directx allocate hierarchy from dx9 to use a skinned mesh system.
one mesh will be only the skeleton with all animations others meshes will be armor, head etc, already skinned with skeleton above. No animation, idle position with skin, thats all I want to use the animation from skeleton to other meshes, so this way I can customize character with different head, armor etc. What I was thinking its copy bone matrices from skeleton mesh to others meshes, but Im a bit confused yet what way I can do this.

Thanks.
• By G-Dot
This is some fotages of enemies for my first game project. I used 3ds Max to model them, substance painter for PBR texturing, Marmoset for rendering. Probably this is he first version of them but not the last.
• By G-Dot
This is some fotages of enemies for my first game project. I used 3ds Max to model them, substance painter for PBR texturing, Marmoset for rendering. Probably this is he first version of them but not the last.
• By G-Dot
This is some fotages of enemies for my first game project. I used 3ds Max to model them, substance painter for PBR texturing, Marmoset for rendering. Probably this is he first version of them but not the last.
• By G-Dot
This is some fotages of enemies for my first game project. I used 3ds Max to model them, substance painter for PBR texturing, Marmoset for rendering. Probably this is he first version of them but not the last.

• 22
• 9
• 9
• 13
• 11