| 74 NULL, |
75 NULL, |
| 75 CX_BUFFER_AUTO_EXTEND |
76 CX_BUFFER_AUTO_EXTEND |
| 76 ); |
77 ); |
| 77 |
78 |
| 78 // initialize SDL |
79 // initialize SDL |
| |
80 const int supported_img_flags = IMG_INIT_PNG | IMG_INIT_JPG; |
| 79 if (SDL_Init(SDL_INIT_VIDEO) < 0) { |
81 if (SDL_Init(SDL_INIT_VIDEO) < 0) { |
| 80 asc_error(SDL_GetError()); |
82 asc_error(SDL_GetError()); |
| 81 } else { |
83 } else if (TTF_Init() < 0) { |
| 82 if (TTF_Init() < 0) { |
84 asc_error(TTF_GetError()); |
| 83 asc_error(TTF_GetError()); |
85 } else if (IMG_Init(supported_img_flags) != supported_img_flags) { |
| 84 } |
86 asc_error(IMG_GetError()); |
| 85 } |
87 } |
| 86 SDL_ClearError(); |
88 SDL_ClearError(); |
| 87 asc_context.total_nanos = asc_nanos(); |
89 asc_context.total_nanos = asc_nanos(); |
| 88 asc_set_flag(asc_context.flags, ASC_FLAG_INITILIZED); |
90 asc_set_flag(asc_context.flags, ASC_FLAG_INITILIZED); |
| 89 asc_dprintf("Ascension context initialized."); |
91 asc_dprintf("Ascension context initialized."); |