34 TEX_SHIP = 0, |
34 TEX_SHIP = 0, |
35 TEX2D_COUNT |
35 TEX2D_COUNT |
36 }; |
36 }; |
37 static AscTexture tex2d[TEX2D_COUNT]; |
37 static AscTexture tex2d[TEX2D_COUNT]; |
38 #define TEXTURE_SHIP &tex2d[TEX_SHIP] |
38 #define TEXTURE_SHIP &tex2d[TEX_SHIP] |
|
39 |
|
40 #define MAIN_SCENE asc_window_scene(0) |
39 |
41 |
40 static void destroy_textures(void *dummy) { |
42 static void destroy_textures(void *dummy) { |
41 asc_texture_destroy(tex2d, TEX2D_COUNT); |
43 asc_texture_destroy(tex2d, TEX2D_COUNT); |
42 } |
44 } |
43 |
45 |
125 // create window |
126 // create window |
126 AscWindowSettings settings; |
127 AscWindowSettings settings; |
127 asc_window_settings_init_defaults(&settings); |
128 asc_window_settings_init_defaults(&settings); |
128 settings.title = "Snake"; |
129 settings.title = "Snake"; |
129 asc_window_initialize(0, &settings); |
130 asc_window_initialize(0, &settings); |
|
131 |
|
132 // initialize the main scene (a 500x500 game field) |
|
133 asc_scene_init(MAIN_SCENE); |
|
134 // TODO: this is intentionally bullshit at the moment to force me to care about aspect ratio |
|
135 asc_camera_ortho(&MAIN_SCENE->camera, (asc_recti){0, 0, 500, 500}); |
130 |
136 |
131 // load textures |
137 // load textures |
132 init_textures(); |
138 init_textures(); |
133 |
139 |
134 // create UI elements |
140 // create UI elements |