summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.c b/main.c
index 8fc0ca3..dbc49d5 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,5 @@
/*
FUTURE FEATURES:
-- custom shaders texture
- config variables
- plugins?
*/
@@ -811,6 +810,15 @@ int main(int argc, char **argv) {
glUniform1f(glGetUniformLocation(shader, "t_time"), (float)fmod(t - start_time, 3600));
glUniform2f(glGetUniformLocation(shader, "t_aspect"), (float)window_width / (float)window_height, 1);
glUniform1f(glGetUniformLocation(shader, "t_save_time"), (float)(t - ted->last_save_time));
+ if (s->bg_texture) {
+ GLuint texture = s->bg_texture->texture;
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, texture);
+ glUniform1i(glGetUniformLocation(shader, "t_texture"), 0);
+ } else {
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, 0);
+ }
glBindBuffer(GL_ARRAY_BUFFER, buffer);
if (!array) {
GLuint v_pos = (GLuint)glGetAttribLocation(shader, "v_pos");