W3DVideobuffer.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. //----------------------------------------------------------------------------
  24. //
  25. // Westwood Studios Pacific.
  26. //
  27. // Confidential Information
  28. // Copyright (C) 2001 - All Rights Reserved
  29. //
  30. //----------------------------------------------------------------------------
  31. //
  32. // Project: Generals
  33. //
  34. // File name: W3DDevice/GameClient/W3DVideoBuffer.h
  35. //
  36. // Created: 10/23/01
  37. //
  38. //----------------------------------------------------------------------------
  39. #pragma once
  40. #ifndef __W3DDEVICE_GAMECLIENT_W3DVIDEOBUFFER_H_
  41. #define __W3DDEVICE_GAMECLIENT_W3DVIDEOBUFFER_H_
  42. //----------------------------------------------------------------------------
  43. // Includes
  44. //----------------------------------------------------------------------------
  45. #include "GameClient/VideoPlayer.h"
  46. //----------------------------------------------------------------------------
  47. // Forward References
  48. //----------------------------------------------------------------------------
  49. class TextureClass;
  50. class SurfaceClass;
  51. //----------------------------------------------------------------------------
  52. // Type Defines
  53. //----------------------------------------------------------------------------
  54. //===============================
  55. // W3DVideoBuffer
  56. //===============================
  57. /**
  58. * Video buffer interface class to a W3D TextureClass
  59. */
  60. //===============================
  61. class W3DVideoBuffer : public VideoBuffer
  62. {
  63. protected:
  64. TextureClass *m_texture;
  65. SurfaceClass *m_surface;
  66. public:
  67. W3DVideoBuffer( Type format );
  68. virtual ~W3DVideoBuffer();
  69. virtual Bool allocate( UnsignedInt width, UnsignedInt height); ///< Allocates buffer
  70. virtual void free( void); ///< Free buffer
  71. virtual void* lock( void ); ///< Returns memory pointer to start of buffer
  72. virtual void unlock( void ); ///< Release buffer
  73. virtual Bool valid( void ); ///< Is the buffer valid to use
  74. TextureClass *texture( void ); ///< Returns texture object
  75. static WW3DFormat TypeToW3DFormat( VideoBuffer::Type format );
  76. static VideoBuffer::Type W3DFormatToType( WW3DFormat w3dFormat );
  77. };
  78. //----------------------------------------------------------------------------
  79. // Inlining
  80. //----------------------------------------------------------------------------
  81. inline TextureClass* W3DVideoBuffer::texture( void ) { return m_texture; }
  82. #endif // __W3DDEVICE_GAMECLIENT_W3DVIDEOBUFFER_H_