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.

94 lines
2.8 KiB

  1. /*
  2. ** Copyright 1991,1992, Silicon Graphics, Inc.
  3. ** All Rights Reserved.
  4. **
  5. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6. ** the contents of this file may not be disclosed to third parties, copied or
  7. ** duplicated in any form, in whole or in part, without the prior written
  8. ** permission of Silicon Graphics, Inc.
  9. **
  10. ** RESTRICTED RIGHTS LEGEND:
  11. ** Use, duplication or disclosure by the Government is subject to restrictions
  12. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15. ** rights reserved under the Copyright Laws of the United States.
  16. **
  17. ** $Revision: 1.8 $
  18. ** $Date: 1993/08/31 16:23:06 $
  19. */
  20. #include "precomp.h"
  21. #pragma hdrstop
  22. #include "devlock.h"
  23. #ifdef NT
  24. void APIPRIVATE __glim_Bitmap(GLsizei w, GLsizei h, GLfloat xOrig, GLfloat yOrig,
  25. GLfloat xMove, GLfloat yMove, const GLubyte *bitmap,
  26. GLboolean _IsDlist)
  27. #else
  28. void APIPRIVATE __glim_Bitmap(GLsizei w, GLsizei h, GLfloat xOrig, GLfloat yOrig,
  29. GLfloat xMove, GLfloat yMove, const GLubyte *bitmap)
  30. #endif
  31. {
  32. __GL_SETUP();
  33. GLuint beginMode;
  34. BOOL bResetViewportAdj = FALSE;
  35. beginMode = gc->beginMode;
  36. if (beginMode != __GL_NOT_IN_BEGIN) {
  37. if (beginMode == __GL_NEED_VALIDATE) {
  38. (*gc->procs.validate)(gc);
  39. gc->beginMode = __GL_NOT_IN_BEGIN;
  40. __glim_Bitmap(w,h,xOrig,yOrig,
  41. xMove,yMove,bitmap,_IsDlist);
  42. return;
  43. } else {
  44. __glSetError(GL_INVALID_OPERATION);
  45. return;
  46. }
  47. }
  48. #ifdef NT
  49. if (((__GLGENcontext *)gc)->pMcdState)
  50. {
  51. // MCD does not hook glBitmap, so we go straight to the
  52. // simulations. Therefore, if we are grabbing the device
  53. // lock lazily, we need to grab it now.
  54. if (!glsrvLazyGrabSurfaces((__GLGENcontext *)gc,
  55. RENDER_LOCK_FLAGS))
  56. return;
  57. // We may need to temporarily reset the viewport adjust values
  58. // before calling simulations. If GenMcdResetViewportAdj returns
  59. // TRUE, the viewport is changed and we need restore later with
  60. // VP_NOBIAS.
  61. bResetViewportAdj = GenMcdResetViewportAdj(gc, VP_FIXBIAS);
  62. }
  63. if (_IsDlist)
  64. {
  65. const __GLbitmap *glbitmap = (const __GLbitmap *) bitmap;
  66. (*gc->procs.renderBitmap)(gc, glbitmap, (const GLubyte *) (glbitmap+1));
  67. }
  68. else
  69. {
  70. #endif
  71. if ((w < 0) || (h < 0)) {
  72. __glSetError(GL_INVALID_VALUE);
  73. return;
  74. }
  75. (*gc->procs.bitmap)(gc, w, h, xOrig, yOrig, xMove, yMove, bitmap);
  76. #ifdef NT
  77. }
  78. #endif
  79. // Restore viewport values if needed.
  80. if (bResetViewportAdj)
  81. {
  82. GenMcdResetViewportAdj(gc, VP_NOBIAS);
  83. }
  84. }