gpt4 book ai didi

javascript - 如何在谷歌闭包库中使用 goog.webgl

转载 作者:行者123 更新时间:2023-11-30 17:19:28 25 4
gpt4 key购买 nike

我想将 WebGL 与 Google Closure Compiler 结合使用(主要用于三维 View )。我查看了库源代码,但发现 goog.webgl 命名空间中当前只有一个文件,它只做常量值定义。

https://github.com/google/closure-library/blob/master/closure/goog/webgl/webgl.js

那么,应该如何使用它呢?没有我可以引用的示例代码吗?

最佳答案

@fileoverview Constants used by the WebGL rendering, including all of the * constants used from the WebGL context. For example, instead of using * context.ARRAY_BUFFER, your code can use * goog.webgl.ARRAY_BUFFER. The benefits for doing this include allowing * the compiler to optimize your code so that the compiled code does not have to * contain large strings to reference these properties, and reducing runtime * property access.

正如文件概述中提到的,goog.webgl 是由 webGl 规范指定的常量列表。

据我所知,Google Closure 没有针对 webGl 的层。我认为您最好的选择是自己编写一些东西,或者简单地将 three.js 之类的库与 Google Closure 结合使用。

关于javascript - 如何在谷歌闭包库中使用 goog.webgl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25416681/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com