Built basic UI Grid.
This commit is contained in:
@ -76,12 +76,14 @@ void shaderInit(shader_t *shader,
|
||||
shader->uniView = glGetUniformLocation(shader->shaderProgram,SHADER_UNI_VIEW);
|
||||
shader->uniText = glGetUniformLocation(shader->shaderProgram,SHADER_UNI_TEXT);
|
||||
shader->uniModl = glGetUniformLocation(shader->shaderProgram,SHADER_UNI_MODL);
|
||||
shader->uniColr = glGetUniformLocation(shader->shaderProgram,SHADER_UNI_COLR);
|
||||
|
||||
// Bind the shader
|
||||
shaderUse(shader);
|
||||
|
||||
// Reset position
|
||||
shaderUsePosition(shader, 0, 0, 0, 0, 0, 0);
|
||||
shaderUseColor(shader, PIXEL_COLOR_WHITE);
|
||||
}
|
||||
|
||||
void shaderDispose(shader_t *shader) {
|
||||
@ -144,4 +146,13 @@ void shaderUsePositionAndScale(shader_t *shader,
|
||||
matrixScale(&matrix, scaleX, scaleY, scaleZ);
|
||||
|
||||
shaderUseMatrix(shader, shader->uniModl, &matrix);
|
||||
}
|
||||
|
||||
void shaderUseColor(shader_t *shader, pixel_t color) {
|
||||
glUniform4f(shader->uniColr,
|
||||
(float)color.r / 255.0f,
|
||||
(float)color.g / 255.0f,
|
||||
(float)color.b / 255.0f,
|
||||
(float)color.a / 255.0f
|
||||
);
|
||||
}
|
@ -91,4 +91,7 @@ void shaderUsePositionAndScale(shader_t *shader,
|
||||
float x, float y, float z,
|
||||
float pitch, float yaw, float roll,
|
||||
float scaleX, float scaleY, float scaleZ
|
||||
);
|
||||
);
|
||||
|
||||
|
||||
void shaderUseColor(shader_t *shader, pixel_t color);
|
Reference in New Issue
Block a user