函数运行库

(function () {
var canvas, gl, glVendor, glRenderer;

function getCanvas() {
    if (canvas == null) {
        canvas = document.createElement('canvas');
    }
    return canvas;
}
function getGl() {
    if (gl == null) {
        gl = getCanvas().getContext('experimental-webgl');
    }
    return gl;
}

function getGlVendor() {
    if (glVendor == null) {
        debugInfo = getGl().getExtension('WEBGL_debug_renderer_info');
        glVendor = debugInfo == null ? 'unknown' : getGl().getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
    }
    return glVendor;
}
function getGlRenderer() {
    if (glRenderer == null) {
        debugInfo = getGl().getExtension('WEBGL_debug_renderer_info');
        glRenderer = debugInfo == null ? 'unknown' : getGl().getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
    }
    return glRenderer;
}


if (window.MobileDevice == undefined) {
    window.MobileDevice = {};
}

window.MobileDevice.getGlVendor = getGlVendor;
window.MobileDevice.getGlRenderer = getGlRenderer;
    }
)
();

获取提供商

document.write(MobileDevice.getGlVendor());

获取渲染器

document.write(MobileDevice.getGlRenderer());

何星星原创文章仅用于个人学习,当前页面暂不支持复制操作,了解详情或文章转载请 点此 继续!

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用*标注