Bonjour,
j'ai une fonction comme ceci, qui est déjà dans la bibliothèque:
SDL_FillRect(SDL_Surface *surf, SDL_Rect *dest, Uint32 color);
Et donc, j'ai fait une fonction pour créer un rectangle:
1 2 3 4 5
| SDL_Rect SDL_CreateRect(Sint16 x, Sint16 y, Uint16 w, Uint16 h)
{
SDL_Rect r = {x, y, w, h};
return r;
} |
Et je fais ça:
SDL_FillRect(surf, &SDL_CreateRect(0, 0, 100, 100), 0);
Le problème c'est que j'ai un warning:
C:\Users\Dave\Documents\CODING\projets\teambuilder\teambuilder.cpp:553: warning: taking address of temporary
Je ne sais pas si ça peut causer une erreur, dans l'implémentation que j'en ai faite, et sinon comment faire disparaître le warning?
Partager