Source code of Windows XP (NT5)
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.

130 lines
2.6 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: wglsrv.c
  3. *
  4. * Routines to support OpenGL client-server implementation on Windows NT.
  5. *
  6. * Created: 01-17-1995
  7. * Author: Hock San Lee [hockl]
  8. *
  9. * Copyright (c) 1995 Microsoft Corporation
  10. \**************************************************************************/
  11. #include "precomp.h"
  12. #pragma hdrstop
  13. #include "wgldef.h"
  14. #ifndef _CLIENTSIDE_
  15. HANDLE __wglCreateContext(HDC hdc, HDC hdcSrvIn, LONG iLayerPlane)
  16. {
  17. HDC hdcSrv;
  18. HANDLE hrcSrv = (HANDLE) 0;
  19. // Get the server-side DC handle.
  20. if (hdcSrvIn != NULL)
  21. {
  22. hdcSrv = hdcSrvIn;
  23. }
  24. else
  25. {
  26. hdcSrv = GdiConvertDC(hdc);
  27. }
  28. if (hdcSrv == (HDC) 0)
  29. {
  30. WARNING1("__wglCreateContext: unexpected bad hdc: 0x%lx\n", hdc);
  31. return(hrcSrv);
  32. }
  33. BEGINMSG(MSG_WGLCREATECONTEXT,WGLCREATECONTEXT)
  34. pmsg->hdc = hdcSrv;
  35. hrcSrv = (HANDLE) CALLSERVER();
  36. ENDMSG
  37. MSGERROR:
  38. return(hrcSrv);
  39. }
  40. BOOL __wglDeleteContext(HANDLE hrcSrv)
  41. {
  42. BOOL bRet = FALSE;
  43. BEGINMSG(MSG_WGLDELETECONTEXT,WGLDELETECONTEXT)
  44. pmsg->hrc = (HGLRC) hrcSrv;
  45. bRet = CALLSERVER();
  46. ENDMSG
  47. MSGERROR:
  48. return(bRet);
  49. }
  50. BOOL __wglMakeCurrent(HDC hdc, HANDLE hrcSrv, HDC hdcSrvIn)
  51. {
  52. HDC hdcSrv = (HDC) 0;
  53. BOOL bRet = FALSE;
  54. // Get the server-side DC handle.
  55. if (hdc)
  56. {
  57. if (hdcSrvIn != NULL)
  58. {
  59. hdcSrv = hdcSrvIn;
  60. }
  61. else
  62. {
  63. hdcSrv = GdiConvertDC(hdc);
  64. }
  65. if (hdcSrv == (HDC) 0)
  66. {
  67. WARNING1("__wglMakeCurrent: unexpected bad hdc: 0x%lx\n", hdc);
  68. return(bRet);
  69. }
  70. }
  71. BEGINMSG(MSG_WGLMAKECURRENT,WGLMAKECURRENT)
  72. pmsg->hdc = hdcSrv;
  73. pmsg->hrc = hrcSrv;
  74. bRet = CALLSERVER();
  75. ENDMSG
  76. MSGERROR:
  77. return(bRet);
  78. }
  79. BOOL __wglShareLists(HANDLE hrcSrvShare, HANDLE hrcSrvSource)
  80. {
  81. BOOL bRet = FALSE;
  82. BEGINMSG(MSG_WGLSHARELISTS, WGLSHARELISTS)
  83. pmsg->hrcSource = hrcSrvSource;
  84. pmsg->hrcShare = hrcSrvShare;
  85. bRet = CALLSERVER();
  86. ENDMSG
  87. MSGERROR:
  88. return(bRet);
  89. }
  90. BOOL __wglAttention()
  91. {
  92. BOOL bRet = FALSE;
  93. // reset user's poll count so it counts this as output
  94. // put it right next to BEGINMSG so that NtCurrentTeb() is optimized
  95. RESETUSERPOLLCOUNT();
  96. BEGINMSG(MSG_GLSBATTENTION, GLSBATTENTION)
  97. bRet = CALLSERVER();
  98. ENDMSG
  99. MSGERROR:
  100. return(bRet);
  101. }
  102. BOOL __wglCopyContext(HANDLE hrcSrvSrc, HANDLE hrcSrvDest, UINT fuFlags)
  103. {
  104. // Server implementation doesn't support this call
  105. return FALSE;
  106. }
  107. #endif // !_CLIENTSIDE_