src/glcontext.c

changeset 89
e1f682a8a145
parent 88
6234b7ea48f3
child 90
aa8e7a38905c
equal deleted inserted replaced
88:6234b7ea48f3 89:e1f682a8a145
73 static void asc_shader_destroy_predefined(AscGLContext *ctx) { 73 static void asc_shader_destroy_predefined(AscGLContext *ctx) {
74 asc_shader_program_destroy(&ctx->shader.sprite.program); 74 asc_shader_program_destroy(&ctx->shader.sprite.program);
75 } 75 }
76 76
77 static int asc_texture_initialize_predefined(AscGLContext *ctx) { 77 static int asc_texture_initialize_predefined(AscGLContext *ctx) {
78 asc_texture_init_rectangle(&ctx->textures.empty_1x1_rect); 78 asc_texture_init_rectangle(&ctx->textures.empty_1x1_rect, 1);
79 asc_texture_init_2d(&ctx->textures.empty_1x1_2d); 79 asc_texture_init_2d(&ctx->textures.empty_1x1_2d, 1);
80 80
81 // Create a 1x1 surface with 32-bit RGBA format 81 // Create a 1x1 surface with 32-bit RGBA format
82 SDL_Surface* white1x1 = SDL_CreateRGBSurface( 82 SDL_Surface* white1x1 = SDL_CreateRGBSurface(
83 0, 1, 1, 32, 83 0, 1, 1, 32,
84 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); 84 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
96 96
97 return asc_error_catch_all_gl(); 97 return asc_error_catch_all_gl();
98 } 98 }
99 99
100 static void asc_texture_destroy_predefined(AscGLContext *ctx) { 100 static void asc_texture_destroy_predefined(AscGLContext *ctx) {
101 asc_texture_destroy(&ctx->textures.empty_1x1_2d); 101 asc_texture_destroy(&ctx->textures.empty_1x1_2d, 1);
102 asc_texture_destroy(&ctx->textures.empty_1x1_rect); 102 asc_texture_destroy(&ctx->textures.empty_1x1_rect, 1);
103 } 103 }
104 104
105 bool asc_gl_context_initialize( 105 bool asc_gl_context_initialize(
106 AscGLContext *ctx, 106 AscGLContext *ctx,
107 SDL_Window *window, 107 SDL_Window *window,

mercurial