MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / initializeTexture

Function initializeTexture

deps/SDL2/Xcode-iOS/Demos/src/touch.c:55–73  ·  view source on GitHub ↗

loads the brush texture */

Source from the content-addressed store, hash-verified

53 loads the brush texture
54*/
55void
56initializeTexture(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
75int
76main(int argc, char *argv[])

Callers 1

mainFunction · 0.70

Calls 5

fatalErrorFunction · 0.85
SDL_FreeSurfaceFunction · 0.85
SDL_SetTextureBlendModeFunction · 0.85
SDL_SetTextureColorModFunction · 0.85

Tested by

no test coverage detected