loads the brush texture */
| 53 | loads the brush texture |
| 54 | */ |
| 55 | void |
| 56 | initializeTexture(SDL_Renderer *renderer) |
| 57 | { |
| 58 | SDL_Surface *bmp_surface; |
| 59 | bmp_surface = SDL_LoadBMP("stroke.bmp"); |
| 60 | if (bmp_surface == NULL) { |
| 61 | fatalError("could not load stroke.bmp"); |
| 62 | } |
| 63 | brush = |
| 64 | SDL_CreateTextureFromSurface(renderer, bmp_surface); |
| 65 | SDL_FreeSurface(bmp_surface); |
| 66 | if (brush == 0) { |
| 67 | fatalError("could not create brush texture"); |
| 68 | } |
| 69 | /* additive blending -- laying strokes on top of eachother makes them brighter */ |
| 70 | SDL_SetTextureBlendMode(brush, SDL_BLENDMODE_ADD); |
| 71 | /* set brush color (red) */ |
| 72 | SDL_SetTextureColorMod(brush, 255, 100, 100); |
| 73 | } |
| 74 | |
| 75 | int |
| 76 | main(int argc, char *argv[]) |
no test coverage detected