Jump to content
  • Advertisement
Sign in to follow this  
mlt

OpenGL From OpenGL to Cg?

This topic is 3619 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 have a vertex program looking something like this:
struct vertex_input
{
  float4 position : POSITION;
  float4 normal   : NORMAL;
};

struct vertex_output
{
  float4 position : POSITION;
  float4 color    : COLOR;
};


vertex_output main(
                     vertex_input IN
                   , uniform float4x4 ModelViewProj
                   , uniform float4x4 ModelViewIT   
                   , uniform float4   light_vector
             )
{
  vertex_output OUT;
...
...

In my C++ application code I do something like this: cgGLBindProgram(....) and then later: glNormalPointer (...); glVertexPointer(...) I assume that its the two above OpenGL calls that binds the normal and vertex coordinates to the corresponding fields in the IN struct in my vertex program. But in the Red bible (OpenGL manual) it does not say anything about these calls communication with a Cg program. And in the Cg tutorial is says nothing about the fields in a IN struct being set using the above OpenGL calls (glNormalPointer, glVertexPointer). Can anyone give a bit more info on how the above connection between the application and the vertex program works?

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!