~ubuntu-branches/ubuntu/trusty/emscripten/trusty-proposed

« back to all changes in this revision

Viewing changes to tests/cubegeom_glew.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20140119141240-jg1l42cc158j59tn
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
int main(int argc, char *argv[])
23
23
{
24
 
    int temp; // testing
 
24
    // testing
 
25
    GLint tempInt;
 
26
    GLboolean tempBool;
 
27
    void *tempPtr;
25
28
 
26
29
    SDL_Surface *screen;
27
30
    if ( SDL_Init(SDL_INIT_VIDEO) != 0 ) {
100
103
 
101
104
    glActiveTexture(GL_TEXTURE0);
102
105
 
103
 
    glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(!temp);
 
106
    glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(!tempBool);
104
107
    glEnableClientState(GL_VERTEX_ARRAY);
105
 
    glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(temp);
 
108
    glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(tempBool);
106
109
 
107
110
    GLuint arrayBuffer, elementBuffer;
108
111
    glGenBuffers(1, &arrayBuffer);
185
188
    glNormalPointer(GL_BYTE, 32, (void*)12);
186
189
    glColorPointer(4, GL_UNSIGNED_BYTE, 32, (void*)28);
187
190
 
188
 
    glGetPointerv(GL_VERTEX_ARRAY_POINTER, &temp); assert(temp == 0);
189
 
    glGetPointerv(GL_COLOR_ARRAY_POINTER, &temp); assert(temp == 28);
190
 
    glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &temp); assert(temp == 16);
191
 
    glGetIntegerv(GL_VERTEX_ARRAY_SIZE, &temp); assert(temp == 3);
192
 
    glGetIntegerv(GL_VERTEX_ARRAY_TYPE, &temp); assert(temp == GL_FLOAT);
193
 
    glGetIntegerv(GL_VERTEX_ARRAY_STRIDE, &temp); assert(temp == 32);
194
 
    glGetIntegerv(GL_COLOR_ARRAY_SIZE, &temp); assert(temp == 4);
195
 
    glGetIntegerv(GL_COLOR_ARRAY_TYPE, &temp); assert(temp == GL_UNSIGNED_BYTE);
196
 
    glGetIntegerv(GL_COLOR_ARRAY_STRIDE, &temp); assert(temp == 32);
197
 
    glGetIntegerv(GL_TEXTURE_COORD_ARRAY_SIZE, &temp); assert(temp == 2);
198
 
    glGetIntegerv(GL_TEXTURE_COORD_ARRAY_TYPE, &temp); assert(temp == GL_FLOAT);
199
 
    glGetIntegerv(GL_TEXTURE_COORD_ARRAY_STRIDE, &temp); assert(temp == 32);
200
 
    glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(temp);
 
191
    glGetPointerv(GL_VERTEX_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)0);
 
192
    glGetPointerv(GL_COLOR_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)28);
 
193
    glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)16);
 
194
    glGetIntegerv(GL_VERTEX_ARRAY_SIZE, &tempInt); assert(tempInt == 3);
 
195
    glGetIntegerv(GL_VERTEX_ARRAY_TYPE, &tempInt); assert(tempInt == GL_FLOAT);
 
196
    glGetIntegerv(GL_VERTEX_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
 
197
    glGetIntegerv(GL_COLOR_ARRAY_SIZE, &tempInt); assert(tempInt == 4);
 
198
    glGetIntegerv(GL_COLOR_ARRAY_TYPE, &tempInt); assert(tempInt == GL_UNSIGNED_BYTE);
 
199
    glGetIntegerv(GL_COLOR_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
 
200
    glGetIntegerv(GL_TEXTURE_COORD_ARRAY_SIZE, &tempInt); assert(tempInt == 2);
 
201
    glGetIntegerv(GL_TEXTURE_COORD_ARRAY_TYPE, &tempInt); assert(tempInt == GL_FLOAT);
 
202
    glGetIntegerv(GL_TEXTURE_COORD_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
 
203
    glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(tempBool);
201
204
 
202
205
    glBindTexture(GL_TEXTURE_2D, texture); // diffuse?
203
206
    glActiveTexture(GL_TEXTURE0);