bool CMyD3DApplication::ValidateVertexBindingType(VertexBindingType type)
{
  bool ret = false;
  switch ( type )
  {
    case VBT_WORLDVIEWPROJ:
      ret = true;
      break;
  }
  return ret;
}
void * CMyD3DApplication::GetVertexBindingType(VertexBindingType type,
// keyword we need the results for
      void *context1,
// up to 2 contexts for this shader
      void *context2)          
//
{
  void * ret = 0;
  switch ( type )
  {
    case VBT_WORLDVIEWPROJ:
      if ( 1 )
      {
        static D3DXMATRIX mat;
        D3DXMatrixMultiply( &mat, &m_matView, &m_matProj );
        D3DXMatrixTranspose( &mat, &mat );
        ret = &mat;
      }
      break;
  return ret;
}

Example 4: Virtual methods that perform the run-time binding.

Back to Article