Team Fortress 2 Source Code as on 22/4/2020
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.

96 lines
3.8 KiB

  1. /*
  2. * CVDirect3DTextureCache.h
  3. * CoreVideo
  4. *
  5. * Copyright 2004 Apple Computer, Inc. All rights reserved.
  6. *
  7. */
  8. #if !defined(__COREVIDEO__CVDIRECT3DTEXTURECACHE_H__)
  9. #define __COREVIDEO__CVDIRECT3DTEXTURECACHE_H__ 1
  10. #include <CVBase.h>
  11. #include <CVReturn.h>
  12. #include <CVBuffer.h>
  13. #include <CVDirect3DTexture.h>
  14. #if defined(__cplusplus)
  15. extern "C" {
  16. #endif
  17. /*!
  18. @typedef CVDirect3DTextureCacheRef
  19. @abstract CoreVideo Direct3D Texture Cache
  20. */
  21. typedef struct __CVDirect3DTextureCache *CVDirect3DTextureCacheRef;
  22. CV_EXPORT CFTypeID CVDirect3DTextureCacheGetTypeID();
  23. /*!
  24. @function CVDirect3DTextureCacheRetain
  25. @abstract Retains a CVDirect3DTextureCache object
  26. @discussion Equivalent to CFRetain, but NULL safe
  27. @param buffer A CVDirect3DTextureCache object that you want to retain.
  28. @result A CVDirect3DTextureCache object that is the same as the passed in buffer.
  29. */
  30. CV_EXPORT CVDirect3DTextureCacheRef CVDirect3DTextureCacheRetain( CVDirect3DTextureCacheRef textureCache ); // NULL-safe
  31. /*!
  32. @function CVDirect3DTextureCacheRelease
  33. @abstract Releases a CVDirect3DTextureCache object
  34. @discussion Equivalent to CFRelease, but NULL safe
  35. @param buffer A CVDirect3DTextureCache object that you want to release.
  36. */
  37. CV_EXPORT void CVDirect3DTextureCacheRelease( CVDirect3DTextureCacheRef textureCache ); // NULL-safe
  38. /*!
  39. @function CVDirect3DTextureCacheCreate
  40. @abstract Creates a new Texture Cache.
  41. @param allocator The CFAllocatorRef to use for allocating the cache. May be NULL.
  42. @param cacheAttributes A CFDictionaryRef containing the attributes of the cache itself. May be NULL.
  43. @param cglContext The D3D context into which the texture objects will be created
  44. @param cglPixelFormat The D3D pixel format object used to create the passed in D3D context
  45. @param textureAttributes A CFDictionaryRef containing the attributes to be used for creating the CVDirect3DTexture objects. May be NULL.
  46. @param cacheOut The newly created texture cache will be placed here
  47. @result Returns kCVReturnSuccess on success
  48. */
  49. CV_EXPORT CVReturn CVDirect3DTextureCacheCreate(
  50. CFAllocatorRef allocator,
  51. CFDictionaryRef cacheAttributes,
  52. void *d3dDevice, /*CVDIRECT3DDEVICE*/
  53. UInt32 d3dFormat, /*D3DFORMAT*/
  54. CFDictionaryRef textureAttributes,
  55. CVDirect3DTextureCacheRef *cacheOut);
  56. /*!
  57. @function CVDirect3DTextureCacheCreateTextureFromImage
  58. @abstract Creates a CVDirect3DTexture object from an existing CVImageBuffer
  59. @param allocator The CFAllocatorRef to use for allocating the CVDirect3DTexture object. May be NULL.
  60. @param sourceImage The CVImageBuffer that you want to create a CVDirect3DTexture from.
  61. @param attribuse The desired buffer attributes for the CVDirect3DTexture.
  62. @param textureOut The newly created texture object will be placed here.
  63. @result Returns kCVReturnSuccess on success
  64. */
  65. CV_EXPORT CVReturn CVDirect3DTextureCacheCreateTextureFromImage(CFAllocatorRef allocator,
  66. CVDirect3DTextureCacheRef textureCache,
  67. CVImageBufferRef sourceImage,
  68. CFDictionaryRef *attribs,
  69. CVDirect3DTextureRef *textureOut);
  70. /*!
  71. @function CVDirect3DTextureCacheFlush
  72. @abstract Performs internal housekeeping/recycling operations
  73. @discussion This call must be made periodically to give the texture cache a chance to make D3D calls
  74. on the Direct3D context used to create it in order to do housekeeping operations.
  75. @param textureCache The texture cache object to flush
  76. @param options Currently unused, set to 0.
  77. @result Returns kCVReturnSuccess on success
  78. */
  79. CV_EXPORT void CVDirect3DTextureCacheFlush(CVDirect3DTextureCacheRef textureCache, CVOptionFlags options);
  80. #if defined(__cplusplus)
  81. }
  82. #endif
  83. #endif