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.

目录
相关文章
|
人工智能 JavaScript 前端开发
多角色AI代理的一次尝试- AI代码助手
本文介绍了一个多角色AI代理系统,用于自动化代码开发过程。系统包括用户接口、需求分析、代码结构设计、代码生成、代码审查和代码执行等角色,通过协调工作实现从需求到代码生成与测试的全流程自动化。使用了qwen2.5 7b模型,展示了AI在软件开发中的潜力。
|
存储 JSON NoSQL
Centos7下安装MongoDB
Centos7下安装MongoDB
599 0
Centos7下安装MongoDB
|
7月前
|
Ubuntu Windows
处理ubuntu启动过程中报错error:proc_thermal_add错误的方法
了解以上方法,就像寻找鬼屋出口的吊灯,当初见“error:proc_thermal_add错误”时的恐惧不翼而飞。各位Ubuntu使用者都是勇敢的探险家,遇到的问题无非是丛林中的野兽,尝试、努力和坚持总能找到解决的办法。
214 21
|
8月前
|
人工智能 Kubernetes Ubuntu
linux配置IP
linux配置IP
819 1
|
存储 关系型数据库 MySQL
MySQL中的列类型之字符串类型总结
MySQL中的列类型之字符串类型总结
930 1
|
安全 搜索推荐 Android开发
探索Android 12的新特性与改进
【6月更文挑战第10天】随着科技的飞速发展,智能手机操作系统也在不断更新迭代。本文将深入探讨Android 12的新特性与改进,帮助读者了解这一最新版本带来的全新体验。
|
数据可视化 算法
MATLAB Simulink 单相半波可控整流电路性能研究
MATLAB Simulink 单相半波可控整流电路性能研究
366 2
|
SQL 物联网 Java
使用Apache IoTDB进行IoT相关开发的架构设计与功能实现(9)
GROUP BY 语句为用户提供了三种类型的指定参数: 参数1:时间轴上的显示窗口 参数2:划分时间轴的时间间隔(应为正) 参数3:时间滑动步长(可选,不应小于时间间隔,如果未设置,则默认等于时间间隔)
491 21
使用Apache IoTDB进行IoT相关开发的架构设计与功能实现(9)
|
XML 设计模式 JavaScript
JVM第三讲:JVM 基础-字节码的增强技术详解
JVM第三讲:JVM 基础-字节码的增强技术详解
509 0
JVM第三讲:JVM 基础-字节码的增强技术详解
|
数据采集 运维 监控
信息系统项目管理师重点内容汇总(第七天)
乘风破浪会有时,直挂云帆济沧海
723 1