Sign in to follow this  

FragmentLinker - Crashes on creation

This topic is 4692 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Im pretty clueless to why this is happening - you can try it yourself. When i execute the code below I get a "DirectXException." Any ideas why this is happening? I'm doing the same as the SDK example, but mine seems to crash...
#region Using directives

using System;
using System.Text;

using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;

#endregion

namespace Fraction_Test
{
    public class Thing : System.Windows.Forms.Form
    {
        public Thing()
        {
            PresentParameters Params = new PresentParameters();
            Params.SwapEffect = SwapEffect.Discard;
            Params.Windowed = true;

            Device Dev = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing,
                Params);

            FragmentLinker fragmentLinker = new FragmentLinker(Dev, 0);
            GraphicsStream Fragments = FragmentLinker.GatherFragmentsFromString(@"
float4x4 matWorld;
float4x4 matWVP;

//---------------------------------------------------------------------------
// Name : Basic Transformation
// Type : Vertex Shader (Fragment)
// Desc : Just transforms the vertices, light the fixed pipeline.
//---------------------------------------------------------------------------
void BasicTransformation( float4 vPosObject: POSITION,
                          float3 vNormalObject: NORMAL,
                          float2 vTexCoordIn: TEXCOORD0,
                          out float4 vPosWorld: r_PosWorld,
                          out float3 vNormalWorld: r_NormalWorld,
                          out float4 vPosProj: POSITION,
                          out float2 vTexCoordOut: TEXCOORD0
                        )
{
    vPosWorld = mul( vPosObject, matWorld );
    vPosProj = mul( vPosObject, matWVP );
    vNormalWorld = mul( vNormalObject, (float3x3)g_mWorld );
    vTexCoordOut = vTexCoordIn;
}
vertexfragment BasicTransformation = compile_fragment vs_1_1 Projection();", ShaderFlags.None);
        }

        public static void Main()
        {
            Thing app = new Thing();
        }
    }
}
Any ideas? Thanks, - aCiD2

Share this post


Link to post
Share on other sites

This topic is 4692 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this