freeTexture

merge-requests/2/merge
Mathis RIBEMONT 4 years ago
parent 99a30ab946
commit ecbcb3afe8

@ -61,19 +61,9 @@ bool drawButtonOnRenderer(SDL_Renderer* renderer, P_Button* button);
bool isHover(P_Button* button, int x,int y);// dit si le bouton est survolé en donnant les coordonnées x,y
/**
* \brief Change the texture of the button
* \param[in] button the button target
* \param[in] texture the texture you want to apply to the button
* \return false if the texture is NULL
*/
bool changeButtonTexture(P_Button* button, SDL_Texture* texture);
/**
* \brief Change the texture to use when the button is hovered
* \param[in] button the button target
* \param[in] texture the texture you want to apply to the button
* \return false if the texture is NULL
* \brief Free the texture of a button.
* \param[in] button the button you want to destroy the texture
*/
bool changeButtonHoverTexture(P_Button* button, SDL_Texture* texture);
void freeButton(P_Button * button);
#endif

@ -55,3 +55,8 @@ bool changeButtonHoverTexture(P_Button* button, SDL_Texture* texture)
button->hoverTexture = texture;
return true;
}
void freeButton(P_Button * button){
SDL_DestroyTexture(button->texture);
SDL_DestroyTexture(button->textureHover);
}

Loading…
Cancel
Save