Add masks to all channels in SDL_CreateRGBSurface calls
[sdl_tbmf.git] / src / SDL_tbmf_errors.h
blob4899a2ab3625ad1d4d30cbe9f1277c1d07183698
1 #ifndef SDL_TBMF_ERRORS_H
2 #define SDL_TBMF_ERRORS_H
4 namespace sdl_tbmf {
5 namespace errors {
7 enum ErrorType {
8 etSuccess, etNoError = 0, etNone = 0, // No errors
9 etFailure, etUnknown = 1, // Unknown/unspecified error
10 etNoMem,
11 etFileOpen,
12 etFileFormat,
13 etFileRead,
14 etSurfaceCreate,
15 etSurfaceLock,
16 etOutsideArray,
17 etCharMapZeroIndex,
18 etCharMapNoNode,
19 etPaletteSet,
20 etNumberOfErrors
23 class Error {
24 public:
25 Error(ErrorType e = etUnknown, const char *s = ""):
26 mType(e), mString(s) {}
27 Error(const char *s): mType(etUnknown), mString(s) {}
29 bool operator==(const Error &o) const { return (mType == o.mType); }
31 void print() const;
33 ErrorType type() const { return mType; }
34 const char *toString() const { return mString; }
36 private:
37 ErrorType mType;
38 const char *mString;
40 static const char *const mErrorStrings[etNumberOfErrors];
43 } // namespace errors
44 } // namespace sdl_tbmf
46 #endif /* SDL_TBMF_ERRORS_H */