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.

103 lines
4.4 KiB

  1. /*
  2. * CVDirect3DBufferPool.h
  3. * CoreVideo
  4. *
  5. * Created by David Eldred based on CVOpenGLBufferPool.h
  6. * Copyright 2004 Apple Computer, Inc. All rights reserved.
  7. *
  8. */
  9. /*! @header CVDirect3DBufferPool.h
  10. @copyright 2004 Apple Computer, Inc. All rights reserved.
  11. @discussion CVDirect3DBufferPool is a utility object for managing a set of CVDirect3DBuffer objects that are going to be recycled.
  12. */
  13. #if !defined(__COREVIDEO__CVDIRECT3DBUFFERPOOL_H__)
  14. #define __COREVIDEO__CVDIRECT3DBUFFERPOOL_H__ 1
  15. #include <CVBase.h>
  16. #include <CVReturn.h>
  17. #include <CVDirect3DBuffer.h>
  18. #if defined(__cplusplus)
  19. extern "C" {
  20. #endif
  21. typedef struct __CVDirect3DBufferPool *CVDirect3DBufferPoolRef;
  22. #define kCVDirect3DBufferPoolMinimumBufferCountKey CFSTR("MinimumBufferCount")
  23. #define kCVDirect3DBufferPoolMaximumBufferAgeKey CFSTR("MaximumBufferAge")
  24. CV_EXPORT CFTypeID CVDirect3DBufferPoolGetTypeID();
  25. /*!
  26. @function CVDirect3DBufferPoolRetain
  27. @abstract Retains a CVDirect3DBufferPoolRef object
  28. @discussion Equivalent to CFRetain, but NULL safe
  29. @param buffer A CVDirect3DBufferPoolRef object that you want to retain.
  30. @result A CVDirect3DBufferPoolRef object that is the same as the passed in buffer.
  31. */
  32. CV_EXPORT CVDirect3DBufferPoolRef CVDirect3DBufferPoolRetain( CVDirect3DBufferPoolRef pixelBufferPool ); // NULL-safe
  33. /*!
  34. @function CVDirect3DBufferPoolRelease
  35. @abstract Releases a CVDirect3DBufferPoolRef object
  36. @discussion Equivalent to CFRelease, but NULL safe
  37. @param buffer A CVDirect3DBufferPoolRef object that you want to release.
  38. */
  39. CV_EXPORT void CVDirect3DBufferPoolRelease( CVDirect3DBufferPoolRef pixelBufferPool ); // NULL-safe
  40. /*!
  41. @function CVDirect3DBufferPoolCreate
  42. @abstract Creates a new Pixel Buffer pool.
  43. @discussion Equivalent to CFRelease, but NULL safe
  44. @param allocator The CFAllocatorRef to use for allocating this buffer pool. May be NULL.
  45. @param poolAttributes A CFDictionaryRef containing the attributes to be used for the pool itself.
  46. @param pixelBufferAttributes A CFDictionaryRef containing the attributes to be used for creating new D3DBuffers within the pool.
  47. @param d3dDevice the LPDIRECT3DDEVICE9 to be used for allocation of buffers for this pool
  48. @param poolOut The newly created pool will be placed here
  49. @result Returns kCVReturnSuccess on success
  50. */
  51. CV_EXPORT CVReturn CVDirect3DBufferPoolCreate(CFAllocatorRef allocator,
  52. CFDictionaryRef poolAttributes,
  53. CFDictionaryRef pixelBufferAttributes,
  54. void *d3dDevice,
  55. CVDirect3DBufferPoolRef *poolOut);
  56. /*!
  57. @function CVDirect3DBufferPoolGetAttributes
  58. @abstract Returns the pool attributes dictionary for a CVDirect3DBufferPool
  59. @param pool The CVDirect3DBufferPoolRef to retrieve the attributes from
  60. @result Returns the pool attributes dictionary, or NULL on failure.
  61. */
  62. CV_EXPORT CFDictionaryRef CVDirect3DBufferPoolGetAttributes(CVDirect3DBufferPoolRef pool);
  63. /*!
  64. @function CVDirect3DBufferPoolGetDirect3DBufferAttributes
  65. @abstract Returns the attributes of pixel buffers that will be created from this pool.
  66. @discussion This function is provided for those cases where you may need to know some information about the buffers that
  67. will be created up front.
  68. @param pool The CVDirect3DBufferPoolRef to retrieve the attributes from
  69. @result Returns the pixel buffer attributes dictionary, or NULL on failure.
  70. */
  71. CV_EXPORT CFDictionaryRef CVDirect3DBufferPoolGetDirect3DBufferAttributes(CVDirect3DBufferPoolRef pool);
  72. /*!
  73. @function CVDirect3DBufferPoolCreateDirect3DBuffer
  74. @abstract Creates a new D3DBuffer object from the pool.
  75. @discussion The function creates a new (attachment-free) CVDirect3DBuffer using the pixel buffer attributes specifed during pool creation.
  76. @param allocator The CFAllocatorRef to use for creating the pixel buffer. May be NULL.
  77. @param pool The CVDirect3DBufferPool that should create the new CVDirect3DBuffer.
  78. @param pixelBufferOut The newly created pixel buffer will be placed here
  79. @result Returns kCVReturnSuccess on success
  80. */
  81. CV_EXPORT CVReturn CVDirect3DBufferPoolCreateDirect3DBuffer(CFAllocatorRef allocator,
  82. CVDirect3DBufferPoolRef pixelBufferPool,
  83. CVDirect3DBufferRef *pixelBufferOut);
  84. #if defined(__cplusplus)
  85. }
  86. #endif
  87. #endif