blob: d590a9b44ab4a1813a94c856ec619d212cb86e58 [file] [log] [blame]
daniel@transgaming.comf8b58a02010-03-26 04:08:45 +00001//
2// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7// geometry/IndexDataManager.h: Defines the IndexDataManager, a class that
8// runs the Buffer translation process for index buffers.
9
10#ifndef LIBGLESV2_GEOMETRY_INDEXDATAMANAGER_H_
11#define LIBGLESV2_GEOMETRY_INDEXDATAMANAGER_H_
12
13#include <bitset>
14#include <cstddef>
15
16#define GL_APICALL
17#include <GLES2/gl2.h>
18
19#include "Context.h"
20
21namespace gl
22{
23
24class Buffer;
25class BufferBackEnd;
26class TranslatedIndexBuffer;
27struct FormatConverter;
28
29struct TranslatedIndexData
30{
31 GLuint minIndex;
32 GLuint maxIndex;
33 GLuint count;
34
35 const Index *indices;
36
37 TranslatedIndexBuffer *buffer;
38 GLsizei offset;
39};
40
41class IndexDataManager
42{
43 public:
44 IndexDataManager(Context *context, BufferBackEnd *backend);
45 ~IndexDataManager();
46
47 TranslatedIndexData preRenderValidate(GLenum mode, GLenum type, GLsizei count, Buffer *arrayElementBuffer, const void *indices);
48
49 private:
50 std::size_t spaceRequired(GLenum mode, GLenum type, GLsizei count);
51
52 Context *mContext;
53 BufferBackEnd *mBackend;
54
55 TranslatedIndexBuffer *mStreamBuffer;
56};
57
58}
59
60#endif // LIBGLESV2_GEOMETRY_INDEXDATAMANAGER_H_