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

« back to all changes in this revision

Viewing changes to tests/aniso.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:
64
64
 
65
65
    const char *exts = (const char *)glGetString(GL_EXTENSIONS);
66
66
    assert(hasext(exts, "GL_EXT_texture_filter_anisotropic"));
67
 
    
 
67
 
68
68
    GLint aniso;
69
69
    glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &aniso);
70
70
    printf("Max anisotropy: %d (using that)\n", aniso);
73
73
    // Set the OpenGL state after creating the context with SDL_SetVideoMode
74
74
 
75
75
    glClearColor( 0, 0, 0, 0 );
76
 
    
77
 
#if !EMSCRIPTEN
78
 
    glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
79
 
#endif
 
76
 
 
77
    glEnable( GL_TEXTURE_2D ); // Needed when we're using the fixed-function pipeline.
80
78
 
81
79
    glViewport( 0, 0, 600, 600 );
82
80
 
155
153
 
156
154
    // Clear the screen before drawing
157
155
    glClear( GL_COLOR_BUFFER_BIT );
158
 
    
 
156
 
159
157
    // Bind the texture to which subsequent calls refer to
160
158
    int w = 10;
161
159
    int n = 15;
200
198
    }
201
199
*/
202
200
    SDL_GL_SwapBuffers();
203
 
    
 
201
 
204
202
#if !EMSCRIPTEN
205
203
    // Wait for 3 seconds to give us a chance to see the image
206
204
    SDL_Delay(2000);
208
206
 
209
207
    // Now we can delete the OpenGL texture and close down SDL
210
208
    glDeleteTextures( 1, &texture );
211
 
    
 
209
 
212
210
    SDL_Quit();
213
 
    
 
211
 
214
212
    return 0;
215
213
}