• Advertisement
Sign in to follow this  

cgFx & cgGLSetParameterPointer problem

This topic is 4145 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

I've written a simple cgFX file. Here it is:

struct VS_INPUT
{
    float2 position: POSITION;
    float2 texcoord: TEXCOORD0;
};


struct VS_OUTPUT
{
    float4 pos : POSITION;
    float2 tc : TEXCOORD0;
};

struct PS_OUTPUT  
{
    float4  color : COLOR;
};

//______________________________________________________________
VS_OUTPUT main(in VS_INPUT input)
{
	VS_OUTPUT  OUT;

	OUT.pos = float4( input.position, 0.0f, 1.0f);
	OUT.tc = input.texcoord;

	return OUT;
}

//______________________________________________________________
PS_OUTPUT fragment_program(VS_OUTPUT IN)
{
	 PS_OUTPUT OUT;
	 
	 OUT.color = float4(1,1,0,1);
	 return OUT;
}

//______________________________________________________________
technique technique_vp10 
{
    pass
	{		
		FragmentProgram  = compile arbfp1 fragment_program();
		VertexProgram = compile arbvp1 main();
	}
}


When I try to set vertex attributes pointer in my program, cgGLEnableClientState and cgGLSetParameterPointer fail with CG_INVALID_PROFILE_ERROR. Here is my related app code:
CGparameter param = cgGetNamedEffectParameter( effect, "input.position");
cgGLEnableClientState(param);
cgGLSetParameterPointer(param, 2, GL_FLOAT, 0, pdata ); 


I am sure my hardware supports arb vertex and fragment program extensions, and I compile the cfFX effect exactly against arb profile. What the problem can be ?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement