File indexing completed on 2025-01-18 10:04:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _OpenGl_TextureBuffer_H__
0016 #define _OpenGl_TextureBuffer_H__
0017
0018 #include <Graphic3d_TextureUnit.hxx>
0019 #include <OpenGl_Buffer.hxx>
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 class OpenGl_TextureBuffer : public OpenGl_Buffer
0032 {
0033 DEFINE_STANDARD_RTTIEXT(OpenGl_TextureBuffer, OpenGl_Buffer)
0034 public:
0035
0036
0037 static const unsigned int NO_TEXTURE = 0;
0038
0039 public:
0040
0041
0042 Standard_EXPORT OpenGl_TextureBuffer();
0043
0044
0045 Standard_EXPORT virtual ~OpenGl_TextureBuffer();
0046
0047
0048 Standard_EXPORT virtual unsigned int GetTarget() const Standard_OVERRIDE;
0049
0050
0051
0052 bool IsValid() const
0053 {
0054 return OpenGl_Buffer::IsValid()
0055 && myTextureId != NO_TEXTURE;
0056 }
0057
0058
0059 Standard_EXPORT virtual void Release (OpenGl_Context* theGlCtx) Standard_OVERRIDE;
0060
0061
0062
0063 Standard_EXPORT bool Create (const Handle(OpenGl_Context)& theGlCtx) Standard_OVERRIDE;
0064
0065
0066
0067 Standard_EXPORT bool Init (const Handle(OpenGl_Context)& theGlCtx,
0068 const unsigned int theComponentsNb,
0069 const Standard_Integer theElemsNb,
0070 const float* theData);
0071
0072
0073
0074 Standard_EXPORT bool Init (const Handle(OpenGl_Context)& theGlCtx,
0075 const unsigned int theComponentsNb,
0076 const Standard_Integer theElemsNb,
0077 const unsigned int* theData);
0078
0079
0080
0081 Standard_EXPORT bool Init (const Handle(OpenGl_Context)& theGlCtx,
0082 const unsigned int theComponentsNb,
0083 const Standard_Integer theElemsNb,
0084 const unsigned short* theData);
0085
0086
0087
0088 Standard_EXPORT bool Init (const Handle(OpenGl_Context)& theGlCtx,
0089 const unsigned int theComponentsNb,
0090 const Standard_Integer theElemsNb,
0091 const Standard_Byte* theData);
0092
0093
0094 Standard_EXPORT void BindTexture (const Handle(OpenGl_Context)& theGlCtx,
0095 const Graphic3d_TextureUnit theTextureUnit) const;
0096
0097
0098 Standard_EXPORT void UnbindTexture (const Handle(OpenGl_Context)& theGlCtx,
0099 const Graphic3d_TextureUnit theTextureUnit) const;
0100
0101
0102 unsigned int TextureId() const { return myTextureId; }
0103
0104
0105 unsigned int TextureFormat() const { return myTexFormat; }
0106
0107 protected:
0108
0109 unsigned int myTextureId;
0110 unsigned int myTexFormat;
0111
0112 };
0113
0114 DEFINE_STANDARD_HANDLE(OpenGl_TextureBuffer, OpenGl_Buffer)
0115
0116 #endif