Jump to content
  • Advertisement
Sign in to follow this  
acid2

FragmentLinker - Crashes on creation

This topic is 5024 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!