WebGL——WebGL 资源(翻译)

https://www.khronos.org/registry/webgl/specs/1.0/ 原文地址

3 WebGL Resources

OpenGL manages several types of resources as part of its state. These are identified by integer object names and are obtained from OpenGL by various creation calls. In contrast WebGL represents these resources as DOM objects. Each object is derived from the WebGLObject interface. Currently supported resources are: textures, buffers (i.e., VBOs), framebuffers, renderbuffers, shaders and programs. The WebGLRenderingContext interface has a method to create a WebGLObject subclass for each type. Data from the underlying graphics library are stored in these objects and are fully managed by them. The resources represented by these objects are guaranteed to exist as long as the object exists. Furthermore, the DOM object is guaranteed to exist as long as the author has an explicit valid reference to it or as long as it is bound by the underlying graphics library. When none of these conditions exist the user agent can, at any point, delete the object using the equivalent of a delete call (e.g., deleteTexture). If authors wish to control when the underlying resource is released then the delete call can be made explicitly.

3 WebGL Resources
OpenGL将多种资源作为它的状态来管理,这些是确定的整数对象名称和从OpenGL中获得各种创建调用。与之相反,WebGL用DOM对象来表现这些资源。每个对象继承WebGLObject接口。目前支持的资源有:纹理、缓冲区、框架缓冲区、渲染缓冲区、着色器、程序集。
WebGLRenderingContext接口具有一个为不同类创建一个WebGLObject父类的方法,从底层图形库的数据存储在这些对象中,而且有这些对象进行全权管理。只有这些对象的存在才能保证表现资源的对象存在。此外,DOM对象是保证存在只要作者有一个明确的有效的对它的引用或者只要是受底层图形库。如果没有这些条件存在,用户代理可以在任何时刻删除对象用,也相当于删除一个调用。如果作者想要在底层的资源被释放的时候控制对象,那么调用可以显式地删除了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

未来AI编程

共鸣===鼓励 打赏您随意

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值