Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
2.6 KiB

  1. /**************************************************************************
  2. * *
  3. * Copyright (C) 1992, Silicon Graphics, Inc. *
  4. * *
  5. * These coded instructions, statements, and computer programs contain *
  6. * unpublished proprietary information of Silicon Graphics, Inc., and *
  7. * are protected by Federal copyright law. They may not be disclosed *
  8. * to third parties or copied or duplicated in any form, in whole or *
  9. * in part, without the prior written consent of Silicon Graphics, Inc. *
  10. * *
  11. **************************************************************************/
  12. /*
  13. * renderhints.c++ - $Revision: 1.2 $
  14. * Derrick Burns - 1991
  15. */
  16. #include "glimport.h"
  17. #include "mystdio.h"
  18. #include "renderhi.h"
  19. #include "defines.h"
  20. #include "nurbscon.h"
  21. /*--------------------------------------------------------------------------
  22. * Renderhints::Renderhints - set all window specific options
  23. *--------------------------------------------------------------------------
  24. */
  25. Renderhints::Renderhints()
  26. {
  27. display_method = N_FILL;
  28. errorchecking = N_MSG;
  29. subdivisions = 6.0;
  30. tmp1 = 0.0;
  31. }
  32. void
  33. Renderhints::init( void )
  34. {
  35. maxsubdivisions = (int) subdivisions;
  36. if( maxsubdivisions < 0 ) maxsubdivisions = 0;
  37. if( display_method == N_FILL ) {
  38. wiretris = 0;
  39. wirequads = 0;
  40. } else if( display_method == N_OUTLINE_TRI ) {
  41. wiretris = 1;
  42. wirequads = 0;
  43. } else if( display_method == N_OUTLINE_QUAD ) {
  44. wiretris = 0;
  45. wirequads = 1;
  46. } else {
  47. wiretris = 1;
  48. wirequads = 1;
  49. }
  50. }
  51. int
  52. Renderhints::isProperty( long property )
  53. {
  54. switch ( property ) {
  55. case N_DISPLAY:
  56. case N_ERRORCHECKING:
  57. case N_SUBDIVISIONS:
  58. case N_TMP1:
  59. return 1;
  60. default:
  61. return 0;
  62. }
  63. }
  64. REAL
  65. Renderhints::getProperty( long property )
  66. {
  67. switch ( property ) {
  68. case N_DISPLAY:
  69. return display_method;
  70. case N_ERRORCHECKING:
  71. return errorchecking;
  72. case N_SUBDIVISIONS:
  73. return subdivisions;
  74. case N_TMP1:
  75. return tmp1;
  76. default:
  77. #ifdef NT
  78. return ((REAL) 0);
  79. #else
  80. abort();
  81. return -1; //not necessary, needed to shut up compiler
  82. #endif
  83. }
  84. }
  85. void
  86. Renderhints::setProperty( long property, REAL value )
  87. {
  88. switch ( property ) {
  89. case N_DISPLAY:
  90. display_method = value;
  91. break;
  92. case N_ERRORCHECKING:
  93. errorchecking = value;
  94. break;
  95. case N_SUBDIVISIONS:
  96. subdivisions = value;
  97. break;
  98. case N_TMP1: /* unused */
  99. tmp1 = value;
  100. break;
  101. default:
  102. #ifndef NT
  103. abort();
  104. #endif
  105. break;
  106. }
  107. }