rc1.0_combiners.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #include "rc1.0_combiners.h"
  2. #include "nvparse_errors.h"
  3. #include "nvparse_externs.h"
  4. #include <string.h>
  5. void CombinersStruct::Validate()
  6. {
  7. if (2 == numConsts &&
  8. cc[0].reg.bits.name == cc[1].reg.bits.name)
  9. errors.set("global constant set twice");
  10. generals.Validate(numConsts, &cc[0]);
  11. final.Validate();
  12. }
  13. void CombinersStruct::Invoke()
  14. {
  15. for (int i = 0; i < numConsts; i++)
  16. glCombinerParameterfvNV(cc[i].reg.bits.name, &(cc[i].v[0]));
  17. generals.Invoke();
  18. final.Invoke();
  19. }
  20. bool is_rc10(const char * s)
  21. {
  22. return ! strncmp(s, "!!RC1.0", 7);
  23. }
  24. bool rc10_init_more()
  25. {
  26. bool rcinit = false;
  27. if(rcinit == false)
  28. {
  29. /*
  30. if(! glh_init_extensions("GL_NV_register_combiners"))
  31. {
  32. errors.set("unable to initialize GL_NV_register_combiners\n");
  33. return false;
  34. }
  35. else
  36. {
  37. */
  38. rcinit = true;
  39. /*
  40. }
  41. */
  42. }
  43. bool rc2init = false;
  44. if(rc2init == false)
  45. {
  46. //glh_init_extensions("GL_NV_register_combiners2");
  47. // Don't fail if this doesn't initialize.
  48. // We will run even if it doesn't exist.
  49. rc2init = true;
  50. }
  51. errors.reset();
  52. line_number = 1;
  53. return true;
  54. }
  55. /*
  56. else if(!strncmp(instring, "!!RC1.0", 7))
  57. {
  58. if(glCombinerParameterfvNV == 0)
  59. {
  60. if(! glh_init_extensions("GL_NV_register_combiners"))
  61. {
  62. errors.set("unable to initialize GL_NV_register_combiners\n");
  63. free(instring);
  64. return;
  65. }
  66. }
  67. if(glCombinerStageParameterfvNV == 0)
  68. {
  69. glh_init_extensions("GL_NV_register_combiners2");
  70. // Don't fail if this doesn't initialize.
  71. // We will run even if it doesn't exist.
  72. }
  73. errors.reset();
  74. line_number = 1;
  75. rc10_init(instring+7);
  76. rc10_parse();
  77. }
  78. */