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>
28 #ifndef __COGL_ATTRIBUTE_PRIVATE_H
29 #define __COGL_ATTRIBUTE_PRIVATE_H
31 #include "cogl-object-private.h"
32 #include "cogl-attribute.h"
33 #include "cogl-framebuffer.h"
37 COGL_ATTRIBUTE_NAME_ID_POSITION_ARRAY,
38 COGL_ATTRIBUTE_NAME_ID_COLOR_ARRAY,
39 COGL_ATTRIBUTE_NAME_ID_TEXTURE_COORD_ARRAY,
40 COGL_ATTRIBUTE_NAME_ID_NORMAL_ARRAY,
41 COGL_ATTRIBUTE_NAME_ID_CUSTOM_ARRAY
42 } CoglAttributeNameID;
44 typedef struct _CoglAttributeNameState
47 CoglAttributeNameID name_id;
49 gboolean normalized_default;
51 } CoglAttributeNameState;
57 CoglAttributeBuffer *attribute_buffer;
58 const CoglAttributeNameState *name_state;
62 CoglAttributeType type;
70 COGL_DRAW_SKIP_JOURNAL_FLUSH = 1 << 0,
71 COGL_DRAW_SKIP_PIPELINE_VALIDATION = 1 << 1,
72 COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH = 1 << 2,
73 COGL_DRAW_SKIP_LEGACY_STATE = 1 << 3,
74 /* By default the vertex attribute drawing code will assume that if
75 there is a color attribute array enabled then we can't determine
76 if the colors will be opaque so we need to enabling
77 blending. However when drawing from the journal we know what the
78 contents of the color array is so we can override this by passing
80 COGL_DRAW_COLOR_ATTRIBUTE_IS_OPAQUE = 1 << 4
83 /* During CoglContext initialization we register the "cogl_color_in"
84 * attribute name so it gets a global name_index of 0. We need to know
85 * the name_index for "cogl_color_in" in
86 * _cogl_pipeline_flush_gl_state() */
87 #define COGL_ATTRIBUTE_COLOR_NAME_INDEX 0
89 CoglAttributeNameState *
90 _cogl_attribute_register_attribute_name (CoglContext *context,
94 _cogl_attribute_immutable_ref (CoglAttribute *attribute);
97 _cogl_attribute_immutable_unref (CoglAttribute *attribute);
100 _cogl_attribute_disable_cached_arrays (void);
103 _cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
104 CoglPipeline *pipeline,
106 CoglAttribute **attributes,
109 #endif /* __COGL_ATTRIBUTE_PRIVATE_H */