Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 24 Oct 2008
Offline Last Active Dec 13 2012 06:43 PM

Posts I've Made

In Topic: SlimDX Directx11 Text Rendering Problem

08 December 2012 - 08:49 PM

I've got everything working now.

I found that missing surface that wasn't getting disposed too. It was because of this line:
		    m_d2dRenderTarget = RenderTarget.FromDXGI(d2dFactory, m_sharedTexture10.AsSurface(), d2d_rtp);

This Texture2D got disposed, but the d2dRenderTarget still had a reference to its surface so the surface did not. I added a new member variable to hold a reference to this surface, and then I added a line in the Dispose() function to dispose this new variable. Now there are 0 live objects.

Thanks again for all the help! It's so great to have it working finally after a couple days! lol

In Topic: SlimDX Directx11 Text Rendering Problem

08 December 2012 - 06:09 AM

Thanks I was just realizing that myself lol. I seem to have another problem though. I added m_TextRenderer.Dispose() in the dispose method of the GameWindowTest class but it still isn't disposing those objects for some reason. I'm not sure why, unless I need to detect when the window is closing and call Dispose(true).

Anyway, I need to get some sleep so I'm gonna get off the computer for now, and mess with it some more later. Thanks again! :)

In Topic: SlimDX Directx11 Text Rendering Problem

08 December 2012 - 04:31 AM

Oh I thought I turned on the native debug. I just realized though that I turned it on for the framework project and not Test App didn't I? lol. I hadn't even checked if I had live objects still. I usually do though but I guess I got too side tracked with hunting bugs. lol. Thanks a bunch though! I'll look at it some more and let you know if I find the problem :)

In Topic: SlimDX Directx11 Text Rendering Problem

08 December 2012 - 02:03 AM

I sent you the project in a .zip file. It's not very big though. Thanks for the help! I really appreciate it. :)

It's gonna end up being some really tiny little detail somewhere probably. The really hard bugs to squash have a tendency to end up that way a lot it seems.

In Topic: SlimDX Directx11 Text Rendering Problem

08 December 2012 - 12:35 AM

No problem. I already put the shader back. Here is the shader code as it is now.

cbuffer cbPerResize : register( b0 )
matrix Projection;
cbuffer cbPerFrame : register( b1 )
matrix View;
cbuffer cbPerObject : register( b2 )
matrix World;
Texture2D ObjTexture;
SamplerState ObjSamplerState;

struct VS_OUTPUT
    float4 Pos : SV_POSITION;
float2 TexCoord : TEXCOORD;

VS_OUTPUT Text_VS(float4 inPos : POSITION, float2 inTexCoord : TEXCOORD)
    VS_OUTPUT output = (VS_OUTPUT)0;

matrix identity;
identity[0] = float4(1,0,0,0);
identity[1] = float4(0,1,0,0);
identity[2] = float4(0,0,1,0);
identity[3] = float4(0,0,0,1);

output.TexCoord = inTexCoord;
    return output;
float4 Text_PS(VS_OUTPUT input) : SV_TARGET
    return ObjTexture.Sample( ObjSamplerState, input.TexCoord );

The shader appears to be working though because I set it to clear the shared texture to opaque blue and it did shade the entire screen opaque blue. But the text is drawn after we clear the buffer obviously, so the text should've been there, but there is only blue. lol The text is set to opaque white in the RenderText function. Once I get it working I'll make the class have a color property instead of setting it every time in that function and make a few other improvements to it. But for now my focus is on getting it working. No sense it potentially adding in new problems before I get the existing one(s) fixed.