- game->texture_cursor = PUSH_LT(
- lt,
- texture_from_bmp("./assets/images/cursor.bmp", renderer),
- SDL_DestroyTexture);
- if (SDL_SetTextureBlendMode(
- game->texture_cursor,
- SDL_ComposeCustomBlendMode(
- SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR,
- SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR,
- SDL_BLENDOPERATION_ADD,
- SDL_BLENDFACTOR_ONE,
- SDL_BLENDFACTOR_ZERO,
- SDL_BLENDOPERATION_ADD)) < 0) {
- log_warn("SDL error: %s\n", SDL_GetError());
+
+ for (Cursor_Style style = 0; style < CURSOR_STYLE_N; ++style) {
+ game->cursor.texs[style] = PUSH_LT(
+ lt,
+ texture_from_bmp(cursor_style_tex_files[style], renderer),
+ SDL_DestroyTexture);
+ if (SDL_SetTextureBlendMode(
+ game->cursor.texs[style],
+ SDL_ComposeCustomBlendMode(
+ SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR,
+ SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR,
+ SDL_BLENDOPERATION_ADD,
+ SDL_BLENDFACTOR_ONE,
+ SDL_BLENDFACTOR_ZERO,
+ SDL_BLENDOPERATION_ADD)) < 0) {
+ log_warn("SDL error while setting blending mode for `%s': %s\n",
+ cursor_style_tex_files[style],
+ SDL_GetError());
+ }