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.

76 lines
1.9 KiB

  1. /******************************Module*Header*******************************\
  2. *
  3. * Module Name: enable.c
  4. * Author: Mark Einkauf
  5. * Purpose: Interface to display driver
  6. *
  7. * Copyright (c) 1997 Cirrus Logic, Inc.
  8. *
  9. \**************************************************************************/
  10. #include "precomp.h"
  11. #include "mcdhw.h"
  12. #include "mcdutil.h"
  13. // Called by display driver from DrvAssertMode
  14. // Need to free any textures in video memory, since video memory is
  15. // about to be reconfigured
  16. VOID AssertModeMCD(
  17. PDEV* ppdev,
  18. BOOL bEnabled)
  19. {
  20. LL_Texture *pTexCtlBlk;
  21. MCDBG_PRINT("AssertModeMCD");
  22. pTexCtlBlk = ppdev->pFirstTexture->next;
  23. while (pTexCtlBlk)
  24. {
  25. if (pTexCtlBlk->pohTextureMap)
  26. {
  27. ppdev->pFreeOffScnMem(ppdev, pTexCtlBlk->pohTextureMap);
  28. pTexCtlBlk->pohTextureMap = NULL;
  29. }
  30. pTexCtlBlk = pTexCtlBlk->next;
  31. }
  32. }
  33. MCDRVGETENTRYPOINTSFUNC CLMCDInit(PPDEV ppdev)
  34. {
  35. int i;
  36. ppdev->cZBufferRef = (LONG) NULL;
  37. ppdev->cDoubleBufferRef = (LONG) NULL;
  38. ppdev->pMCDFilterFunc = (MCDENGESCFILTERFUNC) NULL;
  39. ppdev->pohBackBuffer = (POFMHDL) NULL;
  40. ppdev->pohZBuffer = (POFMHDL) NULL;
  41. ppdev->pAssertModeMCD = AssertModeMCD;
  42. // set pRegs to top of memory mapped register space
  43. ppdev->LL_State.pRegs = (DWORD *)ppdev->pLgREGS;
  44. LL_InitLib(ppdev); // initialize 3d state
  45. // floating point reciprocal table
  46. ppdev->frecips[0]=(float)0.0;
  47. for ( i=1; i<=LAST_FRECIP; i++)
  48. {
  49. ppdev->frecips[i]= (float)1.0 / (float)i;
  50. }
  51. // alloc first (dummy) texture control block
  52. ppdev->pFirstTexture = ppdev->pLastTexture = (LL_Texture *)MCDAlloc(sizeof(LL_Texture));
  53. if ( ppdev->pFirstTexture )
  54. {
  55. ppdev->pFirstTexture->prev = ppdev->pFirstTexture->next = NULL;
  56. ppdev->pFirstTexture->pohTextureMap = NULL;
  57. }
  58. return(MCDrvGetEntryPoints);
  59. }