src/shader.c

changeset 40
6c438be1a1fd
parent 16
c5dde81b6fb2
child 41
df81d493716e
equal deleted inserted replaced
39:7cf310cc47cb 40:6c438be1a1fd
30 #include "ascension/error.h" 30 #include "ascension/error.h"
31 31
32 #include <GL/glew.h> 32 #include <GL/glew.h>
33 #include <string.h> 33 #include <string.h>
34 34
35 AscShaderFont ASC_SHADER_FONT; 35 AscShaderSprite ASC_SHADER_SPRITE;
36 36
37 37
38 AscShader asc_shader_compile(unsigned int type, 38 AscShader asc_shader_compile(unsigned int type,
39 char const *code, 39 char const *code,
40 int length) { 40 int length) {
135 asc_shader_destroy(font_frag); 135 asc_shader_destroy(font_frag);
136 return prog; 136 return prog;
137 } 137 }
138 138
139 void asc_shader_initialize_predefined(void) { 139 void asc_shader_initialize_predefined(void) {
140 ASC_SHADER_FONT.base = asc_shader_compile_link_discard("shader/font_vtx.glsl", "shader/font_frag.glsl"); 140 ASC_SHADER_SPRITE.base = asc_shader_compile_link_discard("shader/sprite_vtx.glsl", "shader/sprite_frag.glsl");
141 ASC_SHADER_FONT.surface = glGetUniformLocation(ASC_SHADER_FONT.base.id, "surface"); 141 ASC_SHADER_SPRITE.surface = glGetUniformLocation(ASC_SHADER_SPRITE.base.id, "surface");
142 } 142 }
143 143
144 void asc_shader_destroy_predefined(void) { 144 void asc_shader_destroy_predefined(void) {
145 asc_shader_program_destroy(ASC_SHADER_FONT.base); 145 asc_shader_program_destroy(ASC_SHADER_SPRITE.base);
146 } 146 }

mercurial