~thumper/nux/next-changes

« back to all changes in this revision

Viewing changes to NuxGraphics/IOpenGLPixelBufferOject.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 21:15:42 UTC
  • Revision ID: neil.patel@canonical.com-20100901211542-cw2ce3ak28unouwb
Add NuxGraphics with licensing

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010 Inalogic Inc.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it 
 
5
 * under the terms of the GNU Lesser General Public License version 3, as
 
6
 * published by the  Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but 
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of 
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR 
 
11
 * PURPOSE.  See the applicable version of the GNU Lesser General Public 
 
12
 * License for more details.
 
13
 * 
 
14
 * You should have received a copy of both the GNU Lesser General Public 
 
15
 * License version 3 along with this program.  If not, see 
 
16
 * <http://www.gnu.org/licenses/>
 
17
 *
 
18
 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
 
19
 *
 
20
 */
 
21
 
 
22
 
 
23
#ifndef IOPENGLPIXELBUFFEROBJECT_H
 
24
#define IOPENGLPIXELBUFFEROBJECT_H
 
25
 
 
26
NAMESPACE_BEGIN_OGL
 
27
 
 
28
class IOpenGLPixelBufferObject: public IOpenGLResource
 
29
{
 
30
    DECLARE_OBJECT_TYPE(IOpenGLPixelBufferObject, IOpenGLResource);
 
31
 
 
32
public:
 
33
    virtual ~IOpenGLPixelBufferObject();
 
34
 
 
35
    int Lock(
 
36
        unsigned int OffsetToLock,
 
37
        unsigned int SizeToLock,
 
38
        void ** ppbData);
 
39
    int Unlock();
 
40
 
 
41
    int GetDescription(INDEXBUFFER_DESC* desc) const
 
42
    {
 
43
        desc->Usage = _Usage;
 
44
        desc->Size = _Length;
 
45
    }
 
46
 
 
47
    void BindPackPixelBufferObject();
 
48
    void BindUnpackPixelBufferObject();
 
49
 
 
50
    t_u32 GetSize();
 
51
 
 
52
private:
 
53
    IOpenGLPixelBufferObject(unsigned int Size, VBO_USAGE Usage);
 
54
 
 
55
    unsigned int _Length;
 
56
    VBO_USAGE _Usage;
 
57
 
 
58
    BYTE* _MemMap;
 
59
    unsigned int  _OffsetToLock;
 
60
    unsigned int  _SizeToLock;
 
61
    friend class GLDeviceFactory;
 
62
};
 
63
 
 
64
NAMESPACE_END_OGL
 
65
 
 
66
#endif // IOPENGLPIXELBUFFEROJECT_H