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

« back to all changes in this revision

Viewing changes to tests/s3tc.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
 
110
108
 
111
109
    // Clear the screen before drawing
112
110
    glClear( GL_COLOR_BUFFER_BIT );
113
 
    
 
111
 
114
112
    // Bind the texture to which subsequent calls refer to
115
113
    glBindTexture( GL_TEXTURE_2D, texture );
116
114
 
143
141
    glEnd();
144
142
 
145
143
    SDL_GL_SwapBuffers();
146
 
    
 
144
 
147
145
#if !EMSCRIPTEN
148
146
    // Wait for 3 seconds to give us a chance to see the image
149
147
    SDL_Delay(1500);
151
149
 
152
150
    // Now we can delete the OpenGL texture and close down SDL
153
151
    glDeleteTextures( 1, &texture );
154
 
    
 
152
 
155
153
    SDL_Quit();
156
 
    
 
154
 
157
155
    return 0;
158
156
}