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.

91 lines
3.3 KiB

  1. /*
  2. * CVDirect3DTexture.h
  3. * CoreVideo
  4. *
  5. * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
  6. *
  7. */
  8. /*! @header CVDirect3DTexture.h
  9. @copyright 2004 Apple Computer, Inc. All rights reserved.
  10. @discussion A CoreVideo Texture derives from an ImageBuffer, and is used for supplying source image data to Direct3D.
  11. */
  12. #if !defined(__COREVIDEO_CVDIRECT3DTEXTURE_H__)
  13. #define __COREVIDEO_CVDIRECT3DTEXTURE_H__ 1
  14. #include <CVBase.h>
  15. #include <CVReturn.h>
  16. #include <CVImageBuffer.h>
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif
  20. #pragma mark CVDirect3DTexture
  21. /*!
  22. @typedef CVDirect3DTextureRef
  23. @abstract Direct3D texture based image buffer
  24. */
  25. typedef CVImageBufferRef CVDirect3DTextureRef;
  26. CV_EXPORT CFTypeID CVDirect3DTextureGetTypeID();
  27. /*!
  28. @function CVDirect3DTextureRetain
  29. @abstract Retains a CVDirect3DTexture object
  30. @discussion Equivalent to CFRetain, but NULL safe
  31. @param buffer A CVDirect3DTexture object that you want to retain.
  32. @result A CVDirect3DTexture object that is the same as the passed in buffer.
  33. */
  34. CV_EXPORT CVDirect3DTextureRef CVDirect3DTextureRetain( CVDirect3DTextureRef texture );
  35. /*!
  36. @function CVDirect3DTextureRelease
  37. @abstract Releases a CVDirect3DTexture object
  38. @discussion Equivalent to CFRelease, but NULL safe
  39. @param buffer A CVDirect3DTexture object that you want to release.
  40. */
  41. CV_EXPORT void CVDirect3DTextureRelease( CVDirect3DTextureRef texture );
  42. /*!
  43. @function CVDirect3DTextureGetName
  44. @abstract Returns the raw texture associated with the CVDirect3DTexture
  45. @param image Target CVDirect3DTexture
  46. @result an LPDIRECT3DTEXTURE9 pointing to the texture
  47. */
  48. CV_EXPORT void* CVDirect3DTextureGetName( CVDirect3DTextureRef image);
  49. /*!
  50. @function CVDirect3DTextureIsFlipped
  51. @abstract Returns whether the image is flipped vertically or not.
  52. @param image Target CVDirect3DTexture
  53. @result True if 0,0 in the texture is upper left, false if 0,0 is lower left
  54. */
  55. CV_EXPORT Boolean CVDirect3DTextureIsFlipped( CVDirect3DTextureRef image);
  56. /*!
  57. @function CVDirect3DTextureGetCleanTexCoords
  58. @abstract Returns convenient texture coordinates for the part of the image that should be displayed
  59. @discussion This function automatically takes into account whether or not the texture is flipped. It returns
  60. texture coordinate values from 0.0 to 1.0 ready for use in a Direct3D VertexBuffer.
  61. @param image Target CVDirect3DTexture
  62. @param lowerLeft - array of two floats where the s and t texture coordinates of the lower left corner of the image will be stored
  63. @param lowerRight - array of two floats where the s and t texture coordinates of the lower right corner of the image will be stored
  64. @param upperRight - array of two floats where the s and t texture coordinates of the upper right corner of the image will be stored
  65. @param upperLeft - array of two floats where the s and t texture coordinates of the upper right corner of the image will be stored
  66. */
  67. CV_EXPORT void CVDirect3DTextureGetCleanTexCoords( CVDirect3DTextureRef image,
  68. float lowerLeft[2],
  69. float lowerRight[2],
  70. float upperRight[2],
  71. float upperLeft[2]);
  72. #if defined(__cplusplus)
  73. }
  74. #endif
  75. #endif