| 124 static void textures_destroy(void) { |
124 static void textures_destroy(void) { |
| 125 asc_texture_destroy(tex2d, TEXTURE_2D_COUNT); |
125 asc_texture_destroy(tex2d, TEXTURE_2D_COUNT); |
| 126 } |
126 } |
| 127 |
127 |
| 128 static void textures_init(void) { |
128 static void textures_init(void) { |
| 129 asc_texture_init_2d(tex2d, TEXTURE_2D_COUNT); |
129 // don't use interpolation for pixel art |
| |
130 asc_texture_init(tex2d, 2, ASC_TEXTURE_2D, |
| |
131 ASC_TEXTURE_MIN_FILTER_NEAREST, ASC_TEXTURE_MAG_FILTER_NEAREST); |
| 130 asc_texture_from_file(TEXTURE_PLAYER, "player.png"); |
132 asc_texture_from_file(TEXTURE_PLAYER, "player.png"); |
| 131 asc_texture_from_file(TEXTURE_PLAYER_COLOR_MAP, "player-color-map.png"); |
133 asc_texture_from_file(TEXTURE_PLAYER_COLOR_MAP, "player-color-map.png"); |
| |
134 // interpolate larger, not pixelated, textures |
| |
135 asc_texture_init(tex2d+2, 1, ASC_TEXTURE_2D, |
| |
136 ASC_TEXTURE_MIN_FILTER_LINEAR, ASC_TEXTURE_MAG_FILTER_LINEAR); |
| 132 asc_texture_from_file(TEXTURE_BACKDROP, "backdrop.png"); |
137 asc_texture_from_file(TEXTURE_BACKDROP, "backdrop.png"); |
| 133 asc_gl_context_add_cleanup_func(asc_active_glctx, textures_destroy); |
138 asc_gl_context_add_cleanup_func(asc_active_glctx, textures_destroy); |
| 134 } |
139 } |
| 135 |
140 |
| 136 static void backdrop_scale(AscBehavior *behavior) { |
141 static void backdrop_scale(AscBehavior *behavior) { |