1.5. 状态 State

简介: 1.5. 状态 State OpenGL was designed as a state machine for updating the contents of a frame buffer.

1.5. 状态 State


OpenGL was designed as a state machine for updating the contents of a frame buffer. The

process of turning geometric primitives, images, and bitmaps into pixels on the screen is

controlled by a fairly large number of state settings. These state settings are orthogonal to one

anothersetting one piece of state does not affect the others. Cumulatively, the state settings

define the behavior of the OpenGL rendering pipeline and the way in which primitives are

transformed into pixels on the display device.

OpenGL state is collected into a data structure called a graphics context. Window-systemspecific

functions create and delete graphics contexts. Another window-system-specific call

designates a graphics context and an OpenGL frame buffer that are used as the targets for

subsequent OpenGL commands.

Quite a few server-side state values in OpenGL have just two states: on or off. To turn a mode

on, you must pass the appropriate symbolic constant to the OpenGL command glEnable. To turn

a mode off, you pass the symbolic constant to glDisable. You enable client-side state (such as

pointers that define vertex arrays) with glEnableClientState and disable it with glDisableClientState.

OpenGL maintains a server-side stack for pushing and popping any or all of the defined state

values. This stack can be manipulated with glPushAttrib and glPopAttrib. Similarly, client state can

be manipulated on a second stack with glPushClientAttrib and glPopClientAttrib.

glGet is a generic function that can query many of the components of a graphics context.

Symbolic constants are defined for simple state items (e.g., GL_CURRENT_COLOR and

GL_LINE_WIDTH), and these values can be passed as arguments to glGet to retrieve the current

value of the indicated component of a graphics context. Variants of glGet return the state value

as an integer, float, double, or boolean. More complex state values are returned by "get"

functions that are specific to that state value, for instance, glGetClipPlane, glGetLight, and

glGetMaterial. Error conditions can be detected with the glGetError function.

目录
相关文章
|
9月前
|
前端开发
为什么调用setState而不是直接改变state
为什么调用setState而不是直接改变state
78 0
|
4月前
|
存储 前端开发 JavaScript
State 状态管理最佳实践
【10月更文挑战第1天】本文深入浅出地介绍了前端开发中的状态管理概念,强调其在构建复杂单页应用(SPA)中的重要性。文章详细阐述了状态管理的核心原则,如单一源真理、状态不可直接修改及状态变更透明,并对比分析了如Redux、Vuex和MobX等常用状态管理库。通过具体代码示例,指出了状态分散和非原子操作等常见问题及其解决方案,为开发者提供了实用指导。
276 1
|
4月前
|
前端开发 开发者
为什么调用 setState 而不是直接改变 state
为什么调用 setState 而不是直接改变 state
|
6月前
|
存储 Kubernetes 调度
在K8S中,pending状态一般由什么原因导致的?
在K8S中,pending状态一般由什么原因导致的?
|
6月前
|
存储 消息中间件 Kubernetes
在K8S中,什么是有状态应用和无状态应用?
在K8S中,什么是有状态应用和无状态应用?
|
9月前
|
前端开发 JavaScript
设置状态:setState
设置状态:setState
|
存储 Kubernetes NoSQL
【K8S系列】第七讲:有状态服务 VS 无状态服务
【K8S系列】第七讲:有状态服务 VS 无状态服务
757 0
beamManagement(二)TCI-state/QCL
上一篇讲解了idle初始接入阶段,基站和UE用SSB的索引,关联PRACH的发送时刻比较内涵的指示了波束信息;在RRC建立进入connected mode后,就可以通过TCI State来指示波束信息, 为利于后续内容理解,这里先看下TCI-state及QCL的概念。
|
前端开发 开发者
使用 this.setState 修改 state 上的数据|学习笔记
快速学习使用 this.setState 修改 state 上的数据
107 0
使用 this.setState 修改 state 上的数据|学习笔记
|
前端开发
使用this.setState修改state上的数据
使用this.setState修改state上的数据
使用this.setState修改state上的数据

热门文章

最新文章