Here’s an example (not what I am doing exactly, but hopefully gets the point across).
namespace SDL{
namespace Surface{
void blit(SDL_Surface *src, SDL_Surface *dest);
}
namespace Audio{
Mix_Chunk* load_sound(const char *file);
}
namespace Color{
SDL_Color mix(int r, int b, int g);
}
}
I don’t fear name clashes since I am writing it all myself but for readability– I think it is more clear. Would this be considered bad practice? Better off all within the SDL namespace? Which is considered better style?
Good comment James 🙂
Personally I like them because I never ever use ‘using’ statements. This IMHO it makes code more readable as you can instantly see where this functions resides etc
eg