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.

129 lines
3.1 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: dl_table.c
  3. *
  4. * Display list API rountines.
  5. *
  6. * Copyright (c) 1995 Microsoft Corporation
  7. \**************************************************************************/
  8. /*
  9. ** Copyright 1991, 1922, Silicon Graphics, Inc.
  10. ** All Rights Reserved.
  11. **
  12. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  13. ** the contents of this file may not be disclosed to third parties, copied or
  14. ** duplicated in any form, in whole or in part, without the prior written
  15. ** permission of Silicon Graphics, Inc.
  16. **
  17. ** RESTRICTED RIGHTS LEGEND:
  18. ** Use, duplication or disclosure by the Government is subject to restrictions
  19. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  20. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  21. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  22. ** rights reserved under the Copyright Laws of the United States.
  23. **
  24. ** Display list table management routines.
  25. **
  26. ** $Revision: 1.12 $
  27. ** $Date: 1993/10/30 00:06:54 $
  28. */
  29. #include "precomp.h"
  30. #pragma hdrstop
  31. /*
  32. ** The next three routines are used as callbacks by the
  33. ** name space management code.
  34. */
  35. /*
  36. ** Delete the specified display list. This typically just means free it,
  37. ** but if it is refcounted we just decrement the ref count.
  38. */
  39. void WINAPIV __glDisposeDlist(__GLcontext *gc, void *pData)
  40. {
  41. __GLdlist *list = pData;
  42. __GL_NAMES_ASSERT_LOCKED(gc->dlist.namesArray);
  43. list->refcount--;
  44. /* less than zero references? */
  45. ASSERTOPENGL((GLint) list->refcount >= 0, "negative refcount!\n");
  46. if (list->refcount == 0)
  47. __glFreeDlist(gc, list);
  48. }
  49. GLboolean APIENTRY
  50. glcltIsList ( IN GLuint list )
  51. {
  52. __GL_SETUP();
  53. // Must use the client side begin state
  54. if (gc->paTeb->flags & POLYARRAY_IN_BEGIN)
  55. {
  56. GLSETERROR(GL_INVALID_OPERATION);
  57. return FALSE;
  58. }
  59. return __glNamesIsName(gc, gc->dlist.namesArray, list);
  60. }
  61. GLuint APIENTRY
  62. glcltGenLists ( IN GLsizei range )
  63. {
  64. __GL_SETUP();
  65. // Must use the client side begin state
  66. if (gc->paTeb->flags & POLYARRAY_IN_BEGIN)
  67. {
  68. GLSETERROR(GL_INVALID_OPERATION);
  69. return 0;
  70. }
  71. if (range < 0) {
  72. GLSETERROR(GL_INVALID_VALUE);
  73. return 0;
  74. }
  75. if (range == 0) {
  76. return 0;
  77. }
  78. return __glNamesGenRange(gc, gc->dlist.namesArray, range);
  79. }
  80. void APIENTRY
  81. glcltListBase ( IN GLuint base )
  82. {
  83. __GL_SETUP();
  84. // Must use the client side begin state
  85. if (gc->paTeb->flags & POLYARRAY_IN_BEGIN)
  86. {
  87. GLSETERROR(GL_INVALID_OPERATION);
  88. return;
  89. }
  90. gc->state.list.listBase = base;
  91. }
  92. void APIENTRY
  93. glcltDeleteLists ( IN GLuint list, IN GLsizei range )
  94. {
  95. __GL_SETUP();
  96. // Must use the client side begin state
  97. if (gc->paTeb->flags & POLYARRAY_IN_BEGIN)
  98. {
  99. GLSETERROR(GL_INVALID_OPERATION);
  100. return;
  101. }
  102. if (range < 0) {
  103. GLSETERROR(GL_INVALID_VALUE);
  104. return;
  105. }
  106. if (range == 0) return;
  107. __glNamesDeleteRange(gc, gc->dlist.namesArray, list, range);
  108. }