1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/m3g/m3gcore11/inc/m3g_vertexarray.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,93 @@
1.4 +/*
1.5 +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: VertexArray interface
1.18 +*
1.19 +*/
1.20 +
1.21 +#ifndef __M3G_VERTEXARRAY_H__
1.22 +#define __M3G_VERTEXARRAY_H__
1.23 +
1.24 +/*!
1.25 + * \internal
1.26 + * \file
1.27 + * \brief VertexArray interface
1.28 + */
1.29 +
1.30 +#include "m3g_object.h"
1.31 +#include "m3g_gl.h"
1.32 +
1.33 +/*!
1.34 + * \internal
1.35 + * \brief \c VertexArray object instance
1.36 + */
1.37 +struct M3GVertexArrayImpl
1.38 +{
1.39 + Object object;
1.40 +
1.41 + M3Gsizei vertexCount;
1.42 + M3Gint mapCount;
1.43 + M3Guint numLocks;
1.44 +
1.45 + GLint elementSize;
1.46 + GLenum elementType;
1.47 + GLsizei stride;
1.48 +
1.49 + M3GMemObject data;
1.50 + M3Gshort rangeMin, rangeMax;
1.51 +
1.52 + /*!
1.53 + * \internal
1.54 + * \brief Cached color array(s?) with premultiplied alpha
1.55 + */
1.56 + M3GMemObject cachedColors;
1.57 +
1.58 + /*!
1.59 + * \internal
1.60 + * \brief Alpha factor for currently stored scaled colors
1.61 + *
1.62 + * anything below zero is considered a dirty value
1.63 + */
1.64 + M3Gint cachedAlphaFactor;
1.65 + M3Gint timestamp;
1.66 +};
1.67 +
1.68 +/* If this assert fails, check the compiler padding settings */
1.69 +M3G_CT_ASSERT(sizeof(VertexArray) == sizeof(Object) + 44);
1.70 +
1.71 +/*----------------------------------------------------------------------
1.72 + * Internal functions
1.73 + *--------------------------------------------------------------------*/
1.74 +
1.75 +static void m3gLockColorArray (const VertexArray *array, M3Gint alphaFactor);
1.76 +static void m3gLockNormalArray (const VertexArray *array);
1.77 +static void m3gLockTexCoordArray(const VertexArray *array);
1.78 +static void m3gLockVertexArray (const VertexArray *array);
1.79 +static void m3gUnlockArray (const VertexArray *array);
1.80 +
1.81 +static M3Gbool m3gCreateAlphaColorCache(VertexArray *array);
1.82 +
1.83 +static VertexArray *m3gCloneVertexArray(const VertexArray *array);
1.84 +static M3Gint m3gGetArrayVertexCount (const VertexArray *array);
1.85 +static M3Gbool m3gIsCompatible (const VertexArray *array, const VertexArray *other);
1.86 +static M3Gint m3gGetArrayTimestamp(const VertexArray *array);
1.87 +static void m3gGetArrayBoundingBox(const VertexArray *array, M3Gshort *boundingBox);
1.88 +static M3Gbool m3gGetCoordinates(VertexArray *va,
1.89 + M3Gint elementCount,
1.90 + M3Gint idx,
1.91 + M3Gfloat *v);
1.92 +
1.93 +static void m3gGetArrayValueRange(const VertexArray *array,
1.94 + M3Gint *minValue, M3Gint *maxValue);
1.95 +
1.96 +#endif /*__M3G_VERTEXARRAY_H__*/