Unofficial OpenGL Software Development Kit: C:/Projects/distro/glsdk_0_5_1/glimg/include/glimg/ImageCreatorExceptions.h Source File

Unofficial OpenGL Software Development Kit 0.5.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ImageCreatorExceptions.h
1
2 #ifndef GLIMG_IMAGE_CREATOR_EXCEPTIONS_H
3 #define GLIMG_IMAGE_CREATOR_EXCEPTIONS_H
4
5 #include <string>
6 #include <exception>
7
8 namespace glimg
9 {
12
14 class ImageCreationException : public std::exception
15 {
16 public:
17 virtual ~ImageCreationException() throw() {}
18
19 virtual const char *what() const throw() {return message.c_str();}
20
21 protected:
22 std::string message;
23 };
24
26 class BadFaceCountException : public ImageCreationException
27 {
28 public:
29 BadFaceCountException()
30 {
31 message = "Must pass 1 or 6 as the face count.";
32 }
33 };
34
36 class CubemapsMustBe2DException : public ImageCreationException
37 {
38 public:
39 CubemapsMustBe2DException()
40 {
41 message = "Textures with a face count of 6 MUST be 2D textures.";
42 }
43 };
44
46 class No3DTextureArrayException : public ImageCreationException
47 {
48 public:
49 No3DTextureArrayException()
50 {
51 message = "Images cannot be 3D arrays.";
52 }
53 };
54
56 class NoImagesSpecifiedException : public ImageCreationException
57 {
58 public:
59 NoImagesSpecifiedException()
60 {
61 message = "Mipmap and array count must be > 0.";
62 }
63 };
64
66 class ArrayOutOfBoundsException : public ImageCreationException
67 {
68 public:
69 ArrayOutOfBoundsException()
70 {
71 message = "Attempted to add an image to an array index that doesn't exist.";
72 }
73 };
74
76 class MipmapLayerOutOfBoundsException : public ImageCreationException
77 {
78 public:
79 MipmapLayerOutOfBoundsException()
80 {
81 message = "Attempted to add an image to a mipmap layer that doesn't exist.";
82 }
83 };
84
86 class FaceIndexOutOfBoundsException : public ImageCreationException
87 {
88 public:
89 FaceIndexOutOfBoundsException()
90 {
91 message = "Attempted to add an image to a face index that doesn't exist.";
92 }
93 };
94
96 class ImageSetAlreadyCreatedException : public ImageCreationException
97 {
98 public:
99 ImageSetAlreadyCreatedException()
100 {
101 message = "Attempted to use an ImageCreator that has already been used to create an ImageSet.";
102 }
103 };
105 }
106
107
108 #endif //GLIMG_IMAGE_CREATOR_EXCEPTIONS_H