sl@0: /* sl@0: * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: VertexArray interface sl@0: * sl@0: */ sl@0: sl@0: #ifndef __M3G_VERTEXARRAY_H__ sl@0: #define __M3G_VERTEXARRAY_H__ sl@0: sl@0: /*! sl@0: * \internal sl@0: * \file sl@0: * \brief VertexArray interface sl@0: */ sl@0: sl@0: #include "m3g_object.h" sl@0: #include "m3g_gl.h" sl@0: sl@0: /*! sl@0: * \internal sl@0: * \brief \c VertexArray object instance sl@0: */ sl@0: struct M3GVertexArrayImpl sl@0: { sl@0: Object object; sl@0: sl@0: M3Gsizei vertexCount; sl@0: M3Gint mapCount; sl@0: M3Guint numLocks; sl@0: sl@0: GLint elementSize; sl@0: GLenum elementType; sl@0: GLsizei stride; sl@0: sl@0: M3GMemObject data; sl@0: M3Gshort rangeMin, rangeMax; sl@0: sl@0: /*! sl@0: * \internal sl@0: * \brief Cached color array(s?) with premultiplied alpha sl@0: */ sl@0: M3GMemObject cachedColors; sl@0: sl@0: /*! sl@0: * \internal sl@0: * \brief Alpha factor for currently stored scaled colors sl@0: * sl@0: * anything below zero is considered a dirty value sl@0: */ sl@0: M3Gint cachedAlphaFactor; sl@0: M3Gint timestamp; sl@0: }; sl@0: sl@0: /* If this assert fails, check the compiler padding settings */ sl@0: M3G_CT_ASSERT(sizeof(VertexArray) == sizeof(Object) + 44); sl@0: sl@0: /*---------------------------------------------------------------------- sl@0: * Internal functions sl@0: *--------------------------------------------------------------------*/ sl@0: sl@0: static void m3gLockColorArray (const VertexArray *array, M3Gint alphaFactor); sl@0: static void m3gLockNormalArray (const VertexArray *array); sl@0: static void m3gLockTexCoordArray(const VertexArray *array); sl@0: static void m3gLockVertexArray (const VertexArray *array); sl@0: static void m3gUnlockArray (const VertexArray *array); sl@0: sl@0: static M3Gbool m3gCreateAlphaColorCache(VertexArray *array); sl@0: sl@0: static VertexArray *m3gCloneVertexArray(const VertexArray *array); sl@0: static M3Gint m3gGetArrayVertexCount (const VertexArray *array); sl@0: static M3Gbool m3gIsCompatible (const VertexArray *array, const VertexArray *other); sl@0: static M3Gint m3gGetArrayTimestamp(const VertexArray *array); sl@0: static void m3gGetArrayBoundingBox(const VertexArray *array, M3Gshort *boundingBox); sl@0: static M3Gbool m3gGetCoordinates(VertexArray *va, sl@0: M3Gint elementCount, sl@0: M3Gint idx, sl@0: M3Gfloat *v); sl@0: sl@0: static void m3gGetArrayValueRange(const VertexArray *array, sl@0: M3Gint *minValue, M3Gint *maxValue); sl@0: sl@0: #endif /*__M3G_VERTEXARRAY_H__*/