Created
September 29, 2015 20:19
-
-
Save arielm/324e10425a71349ff4c0 to your computer and use it in GitHub Desktop.
Emscripten minimal test-case for showcasing issue with anisotropic filtering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GLES2/gl2.h> | |
#include <GLES2/gl2ext.h> | |
#include <stdio.h> | |
#include <emscripten.h> | |
#include <emscripten/html5.h> | |
int main() | |
{ | |
emscripten_set_canvas_size(256, 256); | |
EmscriptenWebGLContextAttributes attrs; | |
emscripten_webgl_init_context_attributes(&attrs); | |
attrs.enableExtensionsByDefault = 1; | |
attrs.majorVersion = 1; | |
attrs.minorVersion = 0; | |
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = emscripten_webgl_create_context(0, &attrs); | |
emscripten_webgl_make_context_current(context); | |
EM_BOOL enabled = emscripten_webgl_enable_extension(context, "EXT_texture_filter_anisotropic"); | |
printf("anisotropy enabled: %d\n", enabled); | |
// GLint maxAnisotropy; | |
// glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy); | |
// printf("max anisotropy: %d\n", maxAnisotropy); | |
GLfloat maxAnisotropy; | |
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy); | |
printf("max anisotropy: %f", maxAnisotropy); | |
GLuint texture; | |
glGenTextures(1, &texture); | |
glBindTexture(GL_TEXTURE_2D, texture); | |
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 4); | |
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 4); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment