Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(858)

Unified Diff: third_party/gles2_book/Common/Source/esShapes.c

Issue 543015: Added simple vertex shader demo.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/gles2_book/Common/Source/esShapes.c
===================================================================
--- third_party/gles2_book/Common/Source/esShapes.c (revision 36016)
+++ third_party/gles2_book/Common/Source/esShapes.c (working copy)
@@ -52,7 +52,7 @@
/// if it is not NULL ) as a GL_TRIANGLE_STRIP
//
int esGenSphere ( int numSlices, float radius, GLfloat **vertices, GLfloat **normals,
- GLfloat **texCoords, GLuint **indices )
+ GLfloat **texCoords, GLushort **indices )
{
int i;
int j;
@@ -72,7 +72,7 @@
*texCoords = malloc ( sizeof(GLfloat) * 2 * numVertices );
if ( indices != NULL )
- *indices = malloc ( sizeof(GLuint) * numIndices );
+ *indices = malloc ( sizeof(GLushort) * numIndices );
for ( i = 0; i < numParallels + 1; i++ )
{
@@ -108,7 +108,7 @@
// Generate the indices
if ( indices != NULL )
{
- GLuint *indexBuf = (*indices);
+ GLushort *indexBuf = (*indices);
for ( i = 0; i < numParallels ; i++ )
{
for ( j = 0; j < numSlices; j++ )
@@ -139,7 +139,7 @@
/// if it is not NULL ) as a GL_TRIANGLE_STRIP
//
int esGenCube ( float scale, GLfloat **vertices, GLfloat **normals,
- GLfloat **texCoords, GLuint **indices )
+ GLfloat **texCoords, GLushort **indices )
{
int i;
int numVertices = 24;
@@ -256,7 +256,7 @@
// Generate the indices
if ( indices != NULL )
{
- GLuint cubeIndices[] =
+ GLushort cubeIndices[] =
{
0, 2, 1,
0, 3, 2,
@@ -272,7 +272,7 @@
20, 22, 21
};
- *indices = malloc ( sizeof(GLuint) * numIndices );
+ *indices = malloc ( sizeof(GLushort) * numIndices );
memcpy( *indices, cubeIndices, sizeof( cubeIndices ) );
}

Powered by Google App Engine
This is Rietveld 408576698