src/opengl/qglbuffer.h
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
    62         IndexBuffer         = 0x8893, // GL_ELEMENT_ARRAY_BUFFER
    62         IndexBuffer         = 0x8893, // GL_ELEMENT_ARRAY_BUFFER
    63         PixelPackBuffer     = 0x88EB, // GL_PIXEL_PACK_BUFFER
    63         PixelPackBuffer     = 0x88EB, // GL_PIXEL_PACK_BUFFER
    64         PixelUnpackBuffer   = 0x88EC  // GL_PIXEL_UNPACK_BUFFER
    64         PixelUnpackBuffer   = 0x88EC  // GL_PIXEL_UNPACK_BUFFER
    65     };
    65     };
    66 
    66 
       
    67     QGLBuffer();
    67     explicit QGLBuffer(QGLBuffer::Type type);
    68     explicit QGLBuffer(QGLBuffer::Type type);
       
    69     QGLBuffer(const QGLBuffer &other);
    68     ~QGLBuffer();
    70     ~QGLBuffer();
       
    71 
       
    72     QGLBuffer &operator=(const QGLBuffer &other);
    69 
    73 
    70     enum UsagePattern
    74     enum UsagePattern
    71     {
    75     {
    72         StreamDraw          = 0x88E0, // GL_STREAM_DRAW
    76         StreamDraw          = 0x88E0, // GL_STREAM_DRAW
    73         StreamRead          = 0x88E1, // GL_STREAM_READ
    77         StreamRead          = 0x88E1, // GL_STREAM_READ
    93     void setUsagePattern(QGLBuffer::UsagePattern value);
    97     void setUsagePattern(QGLBuffer::UsagePattern value);
    94 
    98 
    95     bool create();
    99     bool create();
    96     bool isCreated() const;
   100     bool isCreated() const;
    97 
   101 
       
   102     void destroy();
       
   103 
    98     bool bind() const;
   104     bool bind() const;
    99     void release() const;
   105     void release() const;
   100 
   106 
   101     static void release(QGLBuffer::Type type);
   107     static void release(QGLBuffer::Type type);
   102 
   108 
   112 
   118 
   113     void *map(QGLBuffer::Access access);
   119     void *map(QGLBuffer::Access access);
   114     bool unmap();
   120     bool unmap();
   115 
   121 
   116 private:
   122 private:
   117     QScopedPointer<QGLBufferPrivate> d_ptr;
   123     QGLBufferPrivate *d_ptr;
   118 
   124 
   119     Q_DISABLE_COPY(QGLBuffer)
       
   120     Q_DECLARE_PRIVATE(QGLBuffer)
   125     Q_DECLARE_PRIVATE(QGLBuffer)
   121 };
   126 };
   122 
   127 
   123 QT_END_NAMESPACE
   128 QT_END_NAMESPACE
   124 
   129