Render x/y for UI elements.

This commit is contained in:
2021-09-03 19:02:37 -07:00
parent 282be95493
commit ee9334478f
32 changed files with 196 additions and 155 deletions

View File

@ -8,8 +8,6 @@
#include "image.h"
void imageInit(image_t *image, texture_t *texture) {
image->x = 0;
image->y = 0;
image->quad.verticeCount = -1;
imageSetTexture(image, texture);
}
@ -24,8 +22,8 @@ void imageSetTexture(image_t *image, texture_t *texture) {
quadInit(&image->quad, 0, 0,0,0,0, texture->width,texture->height,1,1);
}
void imageRender(image_t *image, shader_t *shader) {
shaderUsePosition(shader, image->x, image->y, 0, 0, 0, 0);
void imageRender(image_t *image, shader_t *shader, float x, float y) {
shaderUsePosition(shader, x, y, 0, 0, 0, 0);
primitiveDraw(&image->quad, 0, -1);
}