1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 02:17:51 +01:00
Telegram/thirdparty/RMIntro/core/program.c

42 lines
1002 B
C
Raw Normal View History

2014-07-10 16:11:09 +02:00
#include "program.h"
#include "platform_gl.h"
TextureProgram get_texture_program(GLuint program)
{
return (TextureProgram) {
program,
glGetAttribLocation(program, "a_Position"),
glGetAttribLocation(program, "a_TextureCoordinates"),
glGetUniformLocation(program, "u_MvpMatrix"),
glGetUniformLocation(program, "u_TextureUnit"),
glGetUniformLocation(program, "u_Alpha")};
}
ColorProgram get_color_program(GLuint program)
{
return (ColorProgram) {
program,
glGetAttribLocation(program, "a_Position"),
glGetUniformLocation(program, "u_MvpMatrix"),
glGetUniformLocation(program, "u_Color"),
glGetUniformLocation(program, "u_Alpha")};
}
GradientProgram get_gradient_program(GLuint program)
{
return (GradientProgram) {
program,
glGetAttribLocation(program, "a_Position"),
glGetUniformLocation(program, "u_MvpMatrix"),
glGetAttribLocation(program, "a_Color"),
glGetUniformLocation(program, "u_Alpha")};
}