取得WebGL drawing context繪製在canvas上 - gists · GitHub

文章推薦指數: 80 %
投票人數:10人

function initWebGL(canvas) {. var gl;. try {. gl = canvas.getContext("experimental-webgl");. /**. * WebGL Context是一個Javscript DOM物件,此物件提供了完整 ... Skiptocontent Allgists BacktoGitHub Signin Signup Sign in Sign up {{message}} Instantlysharecode,notes,andsnippets. liushihyen/取得WebGLdrawingcontext繪製在canvas上 CreatedJan11,2013 Star 0 Fork 0 Star Code Revisions 1 Embed Whatwouldyouliketodo? Embed Embedthisgistinyourwebsite. Share Copysharablelinkforthisgist. Clonevia HTTPS ClonewithGitorcheckoutwithSVNusingtherepository’swebaddress. LearnmoreaboutcloneURLs DownloadZIP Raw 取得WebGLdrawingcontext繪製在canvas上 ThisfilecontainsbidirectionalUnicodetextthatmaybeinterpretedorcompileddifferentlythanwhatappearsbelow.Toreview,openthefileinaneditorthatrevealshiddenUnicodecharacters. LearnmoreaboutbidirectionalUnicodecharacters Showhiddencharacters functioninitWebGL(canvas){ vargl; try{ gl=canvas.getContext("experimental-webgl"); /** * WebGLContext是一個JavscriptDOM物件,此物件提供了完整的WebGLAPI,他的結構幾乎繼承自 * HTML5的繪圖實體,這也就是為何WebGL也是透過來作繪圖的輸出 * */ }catch(e){ varmsg="ErrorcreatingWebGLContext!:"+e.toString(); alert(msg); throwError(msg); } returngl; } Signupforfree tojointhisconversationonGitHub. Alreadyhaveanaccount? Signintocomment Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.



請為這篇文章評分?