48 cx_strfree(&buf); |
48 cx_strfree(&buf); |
49 } |
49 } |
50 |
50 |
51 static void asc_shader_initialize_predefined(AscGLContext *ctx) { |
51 static void asc_shader_initialize_predefined(AscGLContext *ctx) { |
52 AscShaderSprite *sprite = &ctx->shader.sprite; |
52 AscShaderSprite *sprite = &ctx->shader.sprite; |
53 sprite->base = asc_shader_easy_compile_and_link("shader/sprite_vtx.glsl", "shader/sprite_frag.glsl"); |
53 sprite->program = asc_shader_easy_compile_and_link( |
54 sprite->depth = glGetUniformLocation(sprite->base.id, "depth"); |
54 "shader/sprite_vtx.glsl", |
55 sprite->tex = glGetUniformLocation(sprite->base.id, "texture"); |
55 "shader/sprite_frag.glsl" |
|
56 ); |
|
57 sprite->depth = glGetUniformLocation(sprite->program.id, "depth"); |
|
58 sprite->tex = glGetUniformLocation(sprite->program.id, "texture"); |
56 } |
59 } |
57 |
60 |
58 static void asc_shader_destroy_predefined(AscGLContext *ctx) { |
61 static void asc_shader_destroy_predefined(AscGLContext *ctx) { |
59 asc_shader_program_destroy(ctx->shader.sprite.base); |
62 asc_shader_program_destroy(ctx->shader.sprite.program); |
60 } |
63 } |
61 |
64 |
62 bool asc_gl_context_initialize( |
65 bool asc_gl_context_initialize( |
63 AscGLContext *ctx, |
66 AscGLContext *ctx, |
64 SDL_Window *window, |
67 SDL_Window *window, |