cocos2d / cocos2d-html5

Cocos2d for Web Browsers. Built using JavaScript.
https://www.cocos.com
3.07k stars 902 forks source link

WebGL does not work on Xubuntu 14.04, and possibly all other Linux OS's with X11. #2574

Closed ddalcu closed 9 years ago

ddalcu commented 9 years ago

I could not get webGL to work, even though my browser supports it, I debugged the code, and it seems the problem is in
CCBoot.js::1564

    if (nav.appVersion.indexOf("Win") != -1) osName = sys.OS_WINDOWS;
    else if (iOS) osName = sys.OS_IOS;
    else if (nav.appVersion.indexOf("Mac") != -1) osName = sys.OS_OSX;
    else if (nav.appVersion.indexOf("X11") != -1) osName = sys.OS_UNIX;  //by commenting this line out..fixes it.. i really doubt anyone still uses UNIX these days..., you should add && !Linux to it
    else if (isAndroid) osName = sys.OS_ANDROID;
    else if (nav.appVersion.indexOf("Linux") != -1) osName = sys.OS_LINUX;

This is what chrome reports for appVersion navigator.appVersion "5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"

VisualSJ commented 9 years ago

https://github.com/cocos2d/cocos2d-html5/pull/2583 Here have fixed this problem~~

^.^