Source

gltut / glimg / include / glimg / DdsLoader.h

Jason McKesson 9d52056 















Jason McKesson 2b423ba 

Jason McKesson 9d52056 

















































Jason McKesson 2b423ba 
#ifndef GLIMG_DIRECT_DRAW_SURFACE_LOADER_H
#define GLIMG_DIRECT_DRAW_SURFACE_LOADER_H

#include <string>
#include "ImageSet.h"

namespace glimg
{
	namespace loaders
	{
		namespace dds
		{
			class DdsLoaderException : public std::exception
			{
			public:
			
			    virtual ~DdsLoaderException() throw() {}

				virtual const char *what() {return message.c_str();}

			protected:
				std::string message;
			};

			class DdsFileNotFoundException : public DdsLoaderException
			{
			public:
				explicit DdsFileNotFoundException(const std::string &filename)
				{
					message = "The file \"" + filename + "\" could not be found.";
				}
			};

			class DdsFileMalformedException : public DdsLoaderException
			{
			public:
				DdsFileMalformedException(const std::string &filename, const std::string &msg)
				{
					if(filename.empty())
						message = "The data is not a properly formatted DDS.\n";
					else
						message = "The file \"" + filename + "\" is not a proper DDS file.\n";

					message += msg;
				}
			};

			class DdsFileUnsupportedException : public DdsLoaderException
			{
			public:
				DdsFileUnsupportedException(const std::string &filename, const std::string &msg)
				{
					if(filename.empty())
						message = "The data uses DDS features that are not yet supported.\n";
					else
						message = "The file \"" + filename + "\" uses DDS features that are not yet supported.\n";

					message += msg;
				}
			};

			ImageSet *LoadFromFile(const std::string &filename);
			ImageSet *LoadFromMemory(const unsigned char *buffer, size_t bufSize);
		}
	}
}

#endif //GLIMG_DIRECT_DRAW_SURFACE_LOADER_H
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.