~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/s3tc_crunch.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-06-11 15:45:24 UTC
  • mfrom: (1.2.1) (2.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130611154524-rppb3w6tixlegv4n
Tags: 1.4.7~20130611~a1eb425-1
* New snapshot release
* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    const char *exts = (const char *)glGetString(GL_EXTENSIONS);
64
64
    assert(hasext(exts, "GL_ARB_texture_compression"));
65
65
    assert(hasext(exts, "GL_EXT_texture_compression_s3tc"));
66
 
    
 
66
 
67
67
    // Set the OpenGL state after creating the context with SDL_SetVideoMode
68
68
 
69
69
    glClearColor( 0, 0, 0, 0 );
70
 
    
71
 
#if !EMSCRIPTEN
72
 
    glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
73
 
#endif
 
70
 
 
71
    glEnable( GL_TEXTURE_2D ); // Needed when we're using the fixed-function pipeline.
74
72
 
75
73
    glViewport( 0, 0, 640, 480 );
76
74
 
158
156
 
159
157
    // Clear the screen before drawing
160
158
    glClear( GL_COLOR_BUFFER_BIT );
161
 
    
 
159
 
162
160
    // Bind the texture to which subsequent calls refer to
163
161
    glBindTexture( GL_TEXTURE_2D, texture );
164
162
 
195
193
    glEnd();
196
194
 
197
195
    SDL_GL_SwapBuffers();
198
 
    
 
196
 
199
197
#if !EMSCRIPTEN
200
198
    // Wait for 3 seconds to give us a chance to see the image
201
199
    SDL_Delay(1500);
203
201
 
204
202
    // Now we can delete the OpenGL texture and close down SDL
205
203
    glDeleteTextures( 1, &texture );
206
 
    
 
204
 
207
205
    SDL_Quit();
208
 
    
 
206
 
209
207
    return 0;
210
208
}