Skip to content

Instantly share code, notes, and snippets.

@Mikepicker
Last active February 22, 2018 11:28
Show Gist options
  • Select an option

  • Save Mikepicker/f8cbfdf8db90cefb3f171ba972d7da6a to your computer and use it in GitHub Desktop.

Select an option

Save Mikepicker/f8cbfdf8db90cefb3f171ba972d7da6a to your computer and use it in GitHub Desktop.
// Blank texture for silhouette blitting
SDL_Texture* createBlankTexture(Sint32 w, Sint32 h, SDL_TextureAccess access) {
//Create uninitialized texture
SDL_Texture* newTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, access, w, h);
if(newTexture == NULL) {
printf( "Unable to create blank texture! SDL Error: %s\n", SDL_GetError() );
}
return newTexture;
}
SDL_Texture* silhouetteTexture = createBlankTexture(SCREEN_WIDTH, SCREEN_HEIGHT, SDL_TEXTUREACCESS_TARGET);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment