64 asc_error(TTF_GetError()); |
64 asc_error(TTF_GetError()); |
65 } |
65 } |
66 } |
66 } |
67 SDL_ClearError(); |
67 SDL_ClearError(); |
68 asc_context.total_nanos = asc_nanos(); |
68 asc_context.total_nanos = asc_nanos(); |
69 asc_set_flag(&asc_context.flags, ASC_FLAG_INITILIZED); |
69 asc_set_flag(asc_context.flags, ASC_FLAG_INITILIZED); |
70 asc_dprintf("Ascension context initialized."); |
70 asc_dprintf("Ascension context initialized."); |
71 } |
71 } |
72 |
72 |
73 void asc_context_destroy(void) { |
73 void asc_context_destroy(void) { |
74 for (unsigned int i = 0 ; i < ASC_MAX_WINDOWS ; i++) { |
74 for (unsigned int i = 0 ; i < ASC_MAX_WINDOWS ; i++) { |
102 // dispatch SDL events |
102 // dispatch SDL events |
103 SDL_Event event; |
103 SDL_Event event; |
104 while (SDL_PollEvent(&event)) { |
104 while (SDL_PollEvent(&event)) { |
105 switch (event.type) { |
105 switch (event.type) { |
106 case SDL_QUIT: |
106 case SDL_QUIT: |
107 asc_set_flag(&asc_context.flags, ASC_FLAG_QUIT); |
107 asc_set_flag(asc_context.flags, ASC_FLAG_QUIT); |
108 break; |
108 break; |
109 case SDL_WINDOWEVENT: { |
109 case SDL_WINDOWEVENT: { |
110 if (event.window.event == SDL_WINDOWEVENT_RESIZED) |
110 if (event.window.event == SDL_WINDOWEVENT_RESIZED) |
111 asc_event_window_resized( |
111 asc_event_window_resized( |
112 event.window.windowID, |
112 event.window.windowID, |