当前位置:网站首页>glGetUniformLocation,glUniform4f
glGetUniformLocation,glUniform4f
2022-07-27 07:41:00 【Wangwangfugui】
const char* vs = "void main()\
{\
gl_Position = ftransform();\
}";
const char* ps = "uniform vec4 _color;\
void main()\
{\
gl_FragColor = _color;\
}";
GLint program = createProgram(vs, ps);
// According to the variable name _color Get the corresponding in the shader program uniform The position of the variable ,
// The application operates this _colorId, You can change the uniform Variable
uniform colorId = glGetUniformLocation(program,"_color");
// change uniform
glUseProgram(program);
glUniform4f(colorId,0,1,0,1);// To call before drawing
//.... Code ellipsis
glDrawArrays(GL_TRIANGLE_STRIP,0,4);
glUseProgram(0);
边栏推荐
- 什么是真正的HTAP?(一)背景篇
- Mysql: increase the maximum number of connections
- 单元测试系统化讲解之Mockito
- 【StoneDB Class】入门第一课:数据库知识科普
- Perl: split the external command to be executed into multiple lines
- Codeforces Round #810 (Div.2) A-C
- [golang learning notes 2.1] sorting and searching in arrays in golang
- 用户解锁SM04 SM12
- 「翻译」SAP变式物料的采购如何玩转?看看这篇你就明白了
- Top ten interview questions for software testing (with answers and analysis)
猜你喜欢

Array method and loop in JS

ADC噪声全面分析 -02- ADC 噪声测量方法和相关参数

C语言实现猜数字小游戏项目实战(基于srand函数、rand函数,Switch语句、while循环、if条件判据等)

Graylog 日志服务器单节点部署

Properties类和properties配置文件的理解学习

Plato farm is expected to further expand its ecosystem through elephant swap

Installation and use of apifox

Actual combat of flutter - Request encapsulation (I)

Help send a recruitment, base all over the country. If you are interested, you can come and have a look
![Error when connecting to MySQL: public key retrieval is not allowed [solution]](/img/b3/41523d44924ec203e40453bace6627.png)
Error when connecting to MySQL: public key retrieval is not allowed [solution]
随机推荐
C language implementation of guessing numbers Games project practice (based on srand function, rand function, switch statement, while loop, if condition criterion, etc.)
小程序消息推送配置 Token校验失败,请检查确认
杂谈:最近好多朋友谈出国……
Closed hash and open hash resolve hash conflicts
Bash: create a function that returns a Boolean value
Okaleido生态核心权益OKA,尽在聚变Mining模式
Codeforces Round #810 (Div.2) A-C
A small cotton padded jacket with air leakage
ADC噪声全面分析 -01- ADC噪声的类型以及ADC特性
mysql备份策略
STM32_ Find the cause of entering hardfault_ Handler's function
ADC噪声全面分析 -02- ADC 噪声测量方法和相关参数
C common function integration-3
The error of QT connecting SQLite database and its modification
Gossip: talk with your daughter about why you should learn culture lessons well
Installation and use of apifox
Top ten interview questions for software testing (with answers and analysis)
Systematic explanation of unit testing: mockito
RestTemplate 连接池配置
Apifox安装及使用