d3dtextr.h
上传用户:cydong117
上传日期:2009-11-10
资源大小:638k
文件大小:2k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. //-----------------------------------------------------------------------------
  2. // File: D3DTextr.h
  3. //
  4. // Desc: Functions to manage textures, including creating (loading from a
  5. //       file), restoring lost surfaces, invalidating, and destroying.
  6. //
  7. //       Note: the implementation of these fucntions maintain an internal list
  8. //       of loaded textures. After creation, individual textures are referenced
  9. //       via their ASCII names.
  10. //
  11. // Copyright (c) 1997-1999 Microsoft Corporation. All rights reserved
  12. //-----------------------------------------------------------------------------
  13. #ifndef D3DTEXTR_H
  14. #define D3DTEXTR_H
  15. //#include <ddraw.h>
  16. //#include <d3d.h>
  17. //-----------------------------------------------------------------------------
  18. // Access functions for loaded textures. Note: these functions search
  19. // an internal list of the textures, and use the texture associated with the
  20. // ASCII name.
  21. //-----------------------------------------------------------------------------
  22. LPDIRECTDRAWSURFACE7 D3DTextr_GetSurface( TCHAR* strName );
  23. //-----------------------------------------------------------------------------
  24. // Texture invalidation and restoration functions
  25. //-----------------------------------------------------------------------------
  26. HRESULT D3DTextr_Invalidate( TCHAR* strName );
  27. HRESULT D3DTextr_Restore( TCHAR* strName, LPDIRECT3DDEVICE7 pd3dDevice );
  28. HRESULT D3DTextr_InvalidateAllTextures();
  29. HRESULT D3DTextr_RestoreAllTextures( LPDIRECT3DDEVICE7 pd3dDevice );
  30. //-----------------------------------------------------------------------------
  31. // Texture creation and deletion functions
  32. //-----------------------------------------------------------------------------
  33. #define D3DTEXTR_TRANSPARENTWHITE 0x00000001
  34. #define D3DTEXTR_TRANSPARENTBLACK 0x00000002
  35. #define D3DTEXTR_32BITSPERPIXEL   0x00000004
  36. #define D3DTEXTR_16BITSPERPIXEL   0x00000008
  37. #define D3DTEXTR_CREATEWITHALPHA  0x00000010
  38. HRESULT D3DTextr_CreateTextureFromFile( TCHAR* strName, DWORD dwStage=0L,
  39.                                         DWORD dwFlags=0L );
  40. HRESULT D3DTextr_CreateEmptyTexture( TCHAR* strName, DWORD dwWidth,
  41.                                      DWORD dwHeight, DWORD dwStage,
  42.                                      DWORD dwFlags );
  43. HRESULT D3DTextr_DestroyTexture( TCHAR* strName );
  44. VOID    D3DTextr_SetTexturePath( TCHAR* strTexturePath );
  45. #endif // D3DTEXTR_H