4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2010 Intel Corporation.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see
20 * <http://www.gnu.org/licenses/>.
25 * Robert Bragg <robert@linux.intel.com>
32 #include "cogl-object-private.h"
33 #include "cogl-attribute-buffer.h"
34 #include "cogl-attribute-buffer-private.h"
35 #include "cogl-context-private.h"
37 static void _cogl_attribute_buffer_free (CoglAttributeBuffer *array);
39 COGL_BUFFER_DEFINE (AttributeBuffer, attribute_buffer);
42 cogl_attribute_buffer_new (CoglContext *context,
46 CoglAttributeBuffer *array = g_slice_new (CoglAttributeBuffer);
49 if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
54 /* parent's constructor */
55 _cogl_buffer_initialize (COGL_BUFFER (array),
59 COGL_BUFFER_BIND_TARGET_ATTRIBUTE_BUFFER,
60 COGL_BUFFER_USAGE_HINT_ATTRIBUTE_BUFFER,
61 COGL_BUFFER_UPDATE_HINT_STATIC);
63 _cogl_attribute_buffer_object_new (array);
66 cogl_buffer_set_data (COGL_BUFFER (array),
74 _cogl_attribute_buffer_free (CoglAttributeBuffer *array)
76 /* parent's destructor */
77 _cogl_buffer_fini (COGL_BUFFER (array));
79 g_slice_free (CoglAttributeBuffer, array);