| 46 asc_dprintf("GL debug: %.*s", (int)buf.length, buf.ptr); |
46 asc_dprintf("GL debug: %.*s", (int)buf.length, buf.ptr); |
| 47 } |
47 } |
| 48 cx_strfree(&buf); |
48 cx_strfree(&buf); |
| 49 } |
49 } |
| 50 |
50 |
| |
51 #include "shader_codes.h" |
| |
52 |
| 51 static void asc_shader_initialize_predefined(AscGLContext *ctx) { |
53 static void asc_shader_initialize_predefined(AscGLContext *ctx) { |
| 52 AscShaderSprite *sprite = &ctx->shader.sprite; |
54 AscShaderSprite *sprite = &ctx->shader.sprite; |
| 53 sprite->program = asc_shader_easy_compile_and_link( |
55 sprite->program = asc_shader_program_create(asc_shader_codes_sprite); |
| 54 "shader/sprite_vtx.glsl", |
|
| 55 "shader/sprite_frag.glsl" |
|
| 56 ); |
|
| 57 sprite->depth = glGetUniformLocation(sprite->program.id, "depth"); |
56 sprite->depth = glGetUniformLocation(sprite->program.id, "depth"); |
| 58 sprite->tex = glGetUniformLocation(sprite->program.id, "texture"); |
57 sprite->tex = glGetUniformLocation(sprite->program.id, "texture"); |
| 59 } |
58 } |
| 60 |
59 |
| 61 static void asc_shader_destroy_predefined(AscGLContext *ctx) { |
60 static void asc_shader_destroy_predefined(AscGLContext *ctx) { |