Jason McKesson avatar Jason McKesson committed ccda585

New GLImg dump, includes mipmaps.

Comments (0)

Files changed (20)

glimg/Test/test.cpp

 		testFmt.format.eOrder = ORDER_RGBA;
 		testFmt.format.eBitdepth = BD_PACKED_32_BIT_8888;
 		testFmt.format.lineAlignment = 4;
-		testFmt.forceConvertBits = FORCE_SRGB_COLORSPACE;
+		testFmt.forceConvertBits = FORCE_SRGB_COLORSPACE_FMT;
 		formats.push_back(testFmt);
 
 		//Succeed. GL_RGB5_A1 = 0x8057.
 		testFmt.format.eOrder = ORDER_RGBA;
 		testFmt.format.eBitdepth = BD_PER_COMP_16;
 		testFmt.format.lineAlignment = 4;
-		testFmt.forceConvertBits = FORCE_LUMINANCE_FORMATS;
+		testFmt.forceConvertBits = FORCE_LUMINANCE_FMT;
 		formats.push_back(testFmt);
 
 		//Succeed. GL_R11F_G11F_B10F = 0x8C3A.
 		testFmt.format.eOrder = ORDER_COMPRESSED;
 		testFmt.format.eBitdepth = BD_COMPRESSED;
 		testFmt.format.lineAlignment = 4;
-		testFmt.forceConvertBits = FORCE_BC1_ALPHA_TEXTURE | FORCE_SRGB_COLORSPACE;
+		testFmt.forceConvertBits = FORCE_BC1_ALPHA_FMT | FORCE_SRGB_COLORSPACE_FMT;
 		formats.push_back(testFmt);
 
 		//Fail. Packed + integral = bad.
 		try
 		{
 			GLuint internalFmt = glimg::GetInternalFormat(formats[loop].format, formats[loop].forceConvertBits);
-			OpenGLUploadData upload = glimg::GetUploadFormatType(formats[loop].format, formats[loop].forceConvertBits);
+			OpenGLPixelTransferParams upload = glimg::GetUploadFormatType(formats[loop].format, formats[loop].forceConvertBits);
 			printf("Internal Format of %i: 0x%04x, [format=0x%04x, type=0x%04x]\n", loop, internalFmt,
 				upload.format, upload.type);
 		}

glimg/Test/windows.cpp

 	TestImageFormats();
 
 //	glimg::ImageSet *pImgSet = glimg::loaders::test::TestImage2D();
-	glimg::ImageSet *pImgSet = glimg::loaders::dds::LoadFromFile("bitmap565.dds");
-//	glimg::ImageSet *pImgSet = glimg::loaders::stb::LoadFromFile("bitmap.png");
+	glimg::ImageSet *pImgSet = glimg::loaders::dds::LoadFromFile("pics/bitmapDXT1_mip.dds");
+//	glimg::ImageSet *pImgSet = glimg::loaders::stb::LoadFromFile("pics/bitmap.png");
 
 	texture = glimg::CreateTexture(pImgSet, 0);
+
+	printf("%i\n", pImgSet->GetMipmapCount());
 	glBindTexture(GL_TEXTURE_2D, texture);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 		"source/*.h",
 		"source/*.cpp",
 		"source/*.c",
+		"source/*.inc",
 	};
 
 	configuration "windows"

glimg/include/glimg/DdsLoader.h

 #include <string>
 #include "ImageSet.h"
 
+/**
+\file
+\brief Has all of the DDS-based loaders.
+
+**/
+
 namespace glimg
 {
 	namespace loaders
 	{
+		///Contains the DDS loaders.
 		namespace dds
 		{
+			///\addtogroup module_glimg_exceptions
+			///@{
+
+			///Base class for all exceptions thrown by the DDS loaders.
 			class DdsLoaderException : public std::exception
 			{
 			public:
 				std::string message;
 			};
 
+			///Thrown if the DDS file could not be opened.
 			class DdsFileNotFoundException : public DdsLoaderException
 			{
 			public:
 				}
 			};
 
+			///Thrown if the DDS data is not a valid DDS format.
 			class DdsFileMalformedException : public DdsLoaderException
 			{
 			public:
 				}
 			};
 
+			///Thrown if the DDS format uses features that the loader cannot yet handle.
 			class DdsFileUnsupportedException : public DdsLoaderException
 			{
 			public:
 					message += msg;
 				}
 			};
+			///@}
 
+			/**
+			\brief Loads a DDS file from the disk, given an ASCII filename.
+
+			DDS is a good texture format, because it naturally fits the needs of textures. It
+			supports features like mipmaps and arrays that other image formats do not.
+
+			\throws DdsLoaderException The image could not be loaded.  There are derived classes from this type that could be thrown.
+			\return An ImageSet that represents the loaded image data.
+
+			\todo Get 3D textures working.
+			\todo Get cubemap textures working. With mipmaps.
+			\todo Implement the D3D10 format.
+			\todo Get array textures working. With mipmaps.
+			\todo Get cubemap array textures working.
+			**/
 			ImageSet *LoadFromFile(const std::string &filename);
+
+			///As LoadFromFile, but from an already loaded buffer. The buffer pointer may be deleted after this call.
 			ImageSet *LoadFromMemory(const unsigned char *buffer, size_t bufSize);
+
 		}
 	}
 }

glimg/include/glimg/ImageCreator.h

 
 namespace glimg
 {
+	///\addtogroup module_glimg_creation
+	///@{
 	namespace detail
 	{
 		struct SimpleImage
 		};
 	}
 
+	/**
+	\brief Used to destroy all of the memory provided to the image creation routines.
+	
+	**/
 	class MemoryObject
 	{
 	public:
 		virtual ~MemoryObject() {}
 	};
 
+	///Do not use. Not mature enough yet.
 	class ImageCreator
 	{
 	public:
 		std::vector<detail::SimpleImage> m_simpleImages;
 		std::vector<detail::FullLayerImage> m_fullLayerImages;
 	};
+
+	///@}
 }
 
 

glimg/include/glimg/ImageCreatorExceptions.h

 
 namespace glimg
 {
+	///\addtogroup module_glimg_exceptions
+	///@{
+
 	class ImageCreationException : public std::exception
 	{
 	public:
 			message = "Attempted to add an image to an ImageCreator that has already been used to create an image set.";
 		}
 	};
+	///@}
 }
 
 

glimg/include/glimg/ImageFormat.h

 
 #include <string>
 
+
+/**
+@file
+
+\brief Contains all of the enums and objects related to formats.
+
+\ingroup module_glimg_format
+**/
+
 namespace glimg
 {
+	///\addtogroup module_glimg_format
+	///@{
+
 	/**
 	\brief Describes the basic type of the pixel data.
 
 	The pixel data type of an image represents the basic type of data stored in the image.
-	This can be floating-point, normalized unsigned integer, and the like.
-
-	Compressed formats do not have pixel bitdepths or component ordering.
+	This can be floating-point, normalized unsigned integer, and the like. They also describe
+	if they are compressed. You can test a PixelDataType to see if it is a compressed format
+	by seeing if the value is less than DT_NUM_UNCOMPRESSED_TYPES.
 	**/
-	enum BaseDataType
+	enum PixelDataType
 	{
 		DT_NORM_UNSIGNED_INTEGER,			///<Image data are unsigned integers that is mapped to floats on the range [0, 1].
 		DT_NORM_SIGNED_INTEGER,				///<Image data are signed integers that is mapped to floats on the range [-1, 1].
 	};
 
 	/**
-	\brief Describes the meaning of the pixel data stored in the image.
+	\brief Describes the values stored in a pixel of the image.
 
-	The base data format of an image represents what kind of data is stored in each pixel. If it is
-	color data, it also describes which color components are stored. The order of these components in
-	the image data is not reflected here.
+	Pixels can store between 1 and 4 values. This enumerator defines how many values are stored
+	and what these values mean. It defines the colorspace of the values (sRGB vs. linear),
+	and also whether the values are color or depth values.
 	**/
-	enum BaseDataFormat
+	enum PixelComponents
 	{
 		FMT_COLOR_RED,					///<Image contains 1 color component, namely red.
 		FMT_COLOR_RG,					///<Image contains 2 color components, red and green.
 		FMT_COLOR_RGBX,					///<Image contains 3 color components, red, green, and blue. There is a fourth component, which takes up space in the data but should be discarded.
 		FMT_COLOR_RGBA,					///<Image contains 4 color components, red, green, blue, and alpha.
 		FMT_COLOR_RGB_sRGB,				///<Image contains 3 color components, which are in the sRGB colorspace.
-		FMT_COLOR_RGBX_sRGB,			///<Image contains 3 color components, which are in the sRGB colorspace. There is a fourth component,  which takes up space in the data but should be discarded.
+		FMT_COLOR_RGBX_sRGB,			///<Image contains 3 color components, which are in the sRGB colorspace. There is a fourth component, which takes up space in the data but should be discarded.
 		FMT_COLOR_RGBA_sRGB,			///<Image contains 4 color components; the RGB components are in the sRGB colorspace.
 
 		FMT_DEPTH,						///<Image contains a single depth component.
 	};
 
 	/**
-	\brief Specifies the bitdepth for each component of each value.
+	\brief Specifies the bitdepth for each component of each pixel.
 
 	Each component of each pixel has a particular bitdepth. The bitdepths specified here
 	are either per-component or specify the size of an entire pixel. The PER_COMP
 	enumerators specify the size of each component.
 
 	So if PER_COMP_16 is used with a RGB format, then each pixel takes up 48 bits.
-	This could be using unsigned integers (shorts) or floats (half-floats).
+	This could be using integers (shorts) or floats (half-floats). Whether it is
+	16-bit integers or 16-bit floats is determined by the PixelDataType.
 
 	The PACKED enumerators are for formats where each component does not have
 	the same bitdepth. The number after PACKED specifies the overall bitdepth
 	of the pixel. PACKED_16_BIT means that the pixel takes up 16 bits.
-	The numbers after represent the bitdepth of the individual components, in the oder
+	The numbers after represent the bitdepth of the individual components, in the order
 	specified by the ComponentOrder enumerator.
+
+	PACKED formats that end in "_REV" reverse the order of the components. So 1555_REV
+	means that the lowest 5 bits are the first component, the next 5 are the second, 
+	the 5 after that are the third, and the highest bit is the fourth component.
 	**/
 	enum Bitdepth
 	{
 		BD_NUM_BITDEPTH,
 	};
 
+	/**
+	\brief Stores the enums and data that describes the format of an image.
+	**/
 	struct ImageFormat
 	{
-		BaseDataType eType;
-		BaseDataFormat eFormat;
-		ComponentOrder eOrder;
-		Bitdepth eBitdepth;
+		PixelDataType eType;		///<The type of pixel data.
+		PixelComponents eFormat;	///<The components stored by a pixel.
+		ComponentOrder eOrder;		///<The order of the components of the pixel.
+		Bitdepth eBitdepth;			///<The bitdepth of each pixel component.
 
-		int lineAlignment;
+		int lineAlignment;			///<The byte alignment of a horizontal line of pixel data.
 
+		/**
+		\brief Determines if the values set into this ImageFormat are valid.
+
+		The ImageFormat object has no constructor, and therefore you could conceivably use
+		any combination of parameters. However, there are specific constraints imposed on
+		ImageFormat enumerators. If these constraints fail, then an error results.
+
+		For details on the specifics of validation, see
+		\ref page_glimg_format_validation.
+
+		\return An empty string if the ImageFormat is valid, and an error message if it is not.
+		**/
+		std::string ValidateFormatText() const;
+
+		///As ValidateFormatText, only returns true if valid and false otherwise.
 		bool ValidateFormat() const;
-		std::string ValidateFormatText() const;
 	};
 
+	///@}
 }
 
 

glimg/include/glimg/ImageSet.h

 #ifndef GLIMG_IMAGE_SET_H
 #define GLIMG_IMAGE_SET_H
 
+/**
+\file
+
+\brief Contains the ImageSet class and associated objects.
+**/
+
 #include "ImageFormat.h"
 
 namespace glimg
 {
+	///\addtogroup module_glimg_imageset
+	///@{
+
+	/**
+	\brief Describes the dimensionality of an image.
+	
+	**/
 	struct Dimensions
 	{
-		int numDimensions;
-		int width;
-		int height;
-		int depth;
+		int numDimensions;	///<The number of dimensions of an image. Can be 1, 2, or 3.
+		int width;			///<The width of the image. Always valid.
+		int height;			///<The height of the image. Only valid if numDimensions is 2 or 3.
+		int depth;			///<The depth of the image. Only valid if numDimensions is 3.
 	};
 
 	namespace detail
 	/**
 	\brief Represents a single image of a certain dimensionality.
 	**/
-	class Image
+	class SingleImage
 	{
 	public:
-		~Image();
+		~SingleImage();
 
 		Dimensions GetDimensions() const;
 
 		ImageFormat GetFormat() const;
 
+		/**
+		\brief Retrieves a pointer to this image's pixel data.
+
+		The format of this pixel data is defined by the ImageFormat returned from GetFormat().
+
+		Do not delete this pointer. It is owned by this object (and the ImageSet it came from).
+		**/
 		const void *GetImageData() const;
 
 	private:
 		friend class detail::ImageSetImpl;
 		friend class ImageSet;
 
-		Image(const detail::ImageSetImpl *pImpl, int arrayIx, int faceIx, int mipmapLevel);
+		SingleImage(const detail::ImageSetImpl *pImpl, int arrayIx, int faceIx, int mipmapLevel);
 	};
 
 	/**
 		~ImageSet();
 
 		/**
-		\brief Returns the number of dimensions in this image set, as well as the size of the base mipmap image.
-		
-		This function will return the number of dimensions that the images in the image set contains.
-		It also returns the size in pixels of the base image. For dimensions less than 3,
-		the base image size will be 0 for the dimensions that aren't present. For example, if
-		the image is 2D, the ImageDimensions::depth will be zero.
+		\brief Returns the dimensionality of the base mipmap image.
 		**/
 		Dimensions GetDimensions() const;
 
 
 		This function will return the number of array images in the image set. The minimum is 1.
 
-		The API makes no distinction between an array of length 1 and a non-array texture.
-		If such a distinction needs to be made, it should be made in the uploading, not in the storage.
+		This API makes no distinction between an array of length 1 and a non-array texture.
+		If such a distinction needs to be made, it should be made in the uploading of the image's data,
+		not in the ImageSet.
 		**/
 		int GetArrayCount() const;
 
 		/**
 		\brief Returns the number of mipmap levels the image set contains.
 
-		This function will return the number of mipmap levels in the image set. The minimum is 1.
-		
+		\return The number of mipmap levels in the image set. The minimum is 1.
 		**/
 		int GetMipmapCount() const;
 
 		/**
 		\brief Returns the number of faces in the image set.
 
-		This function will return the number of faces in the image set. This will be 1 for regular
-		images, and 6 for cubemaps and cubemap arrays.
+		\return The number of faces in the image set. It will be 1 for regular images,
+		and 6 for cubemaps and cubemap arrays.
 		**/
 		int GetFaceCount() const;
 
 		/**
 		\brief Retrieves the image format that describes all images in this ImageSet.
-		
 		**/
 		ImageFormat GetFormat() const;
 
 		/**
-		\brief Retrieves the image at the given array index, face index, and mipmap level.
+		\brief Retrieves the image at the given mipmap level, array index, and face index.
 		
-		\return A pointer to the image. Do not use it after the ImageSet object is destroyed. This pointer must be deleted manually.
+		\return A pointer to the image. Do not use it after the ImageSet object is destroyed.
+		This pointer must be deleted manually.
 		**/
-		Image *GetImage(int ixMipmapLevel, int ixArray = 0, int ixFace = 0) const;
+		SingleImage *GetImage(int ixMipmapLevel, int ixArray = 0, int ixFace = 0) const;
 
 		/**
 		\brief Retrieves a pointer to the full array data for a mipmap level.
 		
-		\return A pointer to the image data. DO NOT DELETE THIS POINTER. Also, do not use this pointer after this object is destroyed.
+		\return A pointer to the image data. DO NOT DELETE THIS POINTER. Also, do not use this
+		pointer after this object is destroyed.
 		**/
 		const void *GetImageArray(int ixMipmapLevel) const;
 
 		friend class ImageCreator;
 		friend void CreateTexture(unsigned int textureName, const ImageSet *pImage, unsigned int forceConvertBits);
 	};
+
+	///@}
 }
 
 

glimg/include/glimg/Loaders.h

 #ifndef GLIMG_LOADERS_H
 #define GLIMG_LOADERS_H
 
+/**
+\file
 
-#include "TestLoader.h"
+\brief Includes all of the image loaders.
+**/
+
 #include "StbLoader.h"
 #include "DdsLoader.h"
 

glimg/include/glimg/StbLoader.h

 #include <string>
 #include "ImageSet.h"
 
+/**
+\file
+\brief Has the STB-based image loading functions.
+
+**/
+
 namespace glimg
 {
 	namespace loaders
 	{
+		/**
+		\brief Contains the STB loaders.
+		
+		**/
 		namespace stb
 		{
+			///\addtogroup module_glimg_exceptions
+			///@{
+
+			///Base class for all exceptions thrown by the STB loaders.
 			class StbLoaderException : public std::exception
 			{
 			public:
 				std::string message;
 			};
 
+			///Thrown when the STB loader could not load the image.
 			class UnableToLoadException : public StbLoaderException
 			{
 			public:
 					message = "The memory buffer could not be loaded by STB_image.";
 				}
 
-				explicit UnableToLoadException(const std::string filename)
+				explicit UnableToLoadException(const std::string &filename)
 				{
 					message = "The file " + filename + " could not be loaded by STB_image.";
 				}
 			};
+			///@}
 
+			/**
+			\brief Loads a file from the disk, given an ASCII filename.
+
+			This loader uses the STB library to process the files. It therefore can load the
+			following image formats:
+
+			\li PNG
+			\li JPEG (non-progressive)
+			\li BMP
+			\li TGA
+			\li GIF
+
+			\throws StbLoaderException Could not load the image. There are derived classes from this type that could be thrown.
+			\return An ImageSet that represents the loaded image data.
+			**/
 			ImageSet *LoadFromFile(const std::string &filename);
+
+			///As LoadFromFile, but from an already loaded buffer. The buffer pointer may be deleted after this call.
 			ImageSet *LoadFromMemory(const unsigned char *buffer, size_t bufSize);
 		}
 	}

glimg/include/glimg/TestLoader.h

 	{
 		namespace test
 		{
+			///\internal
 			glimg::ImageSet *TestImage2D();
 		}
 	}

glimg/include/glimg/TextureGenerator.h

 #ifndef GLIMG_TEXTURE_GENERATOR_H
 #define GLIMG_TEXTURE_GENERATOR_H
 
+/**
+\file
+\brief Functions for generating textures and OpenGL-specific information.
+
+**/
+
+
 #include "ImageSet.h"
 
 
 namespace glimg
 {
-	enum ForcedConvertBits
+	///\addtogroup module_glimg_texture
+	///@{
+
+	/**
+	\brief Control flags for texture conversion processes.
+
+	These flags allow the user to alter the process used to select image formats and upload
+	texture data. The enumerators that end in "FMT" affect how the format is chosen, while
+	the ones ending in "TEX" affect the texture choice.
+	
+	\todo Finish implementing color renderable forcing.
+	\todo Implement the forcing of required formats.
+	**/
+	enum ForcedConvertFlags
 	{
-		FORCE_SRGB_COLORSPACE		= 0x0001,	///<When possible, will force the format to use the sRGB colorspace. Does not cause erroring for formats that can't be sRGB, unless your GL implementation doesn't support sRGB.
-		FORCE_BC1_ALPHA_TEXTURE		= 0x0002,	///<When used with a BC1 texture, will force the texture to have an alpha.
-		FORCE_ARRAY_TEXTURE			= 0x0004,	///<The texture will be an array texture even if the depth is one. Ignored for formats that can't be arrays. Will throw if array textures of that type are not supported (ie: cubemap arrays, 2D arrays for lesser hardware, etc).
-		FORCE_LUMINANCE_FORMATS		= 0x0008,	///<Red and RG textures will become luminance and luminance/alpha textures in all cases. Exceptions will be thrown if the GL implementation does not support those luminance/alpha formats.
+		FORCE_SRGB_COLORSPACE_FMT	= 0x0001,	///<When possible, will force the format to use the sRGB colorspace. Does not cause erroring for formats that can't be sRGB, unless your GL implementation doesn't support sRGB.
+		FORCE_BC1_ALPHA_FMT			= 0x0002,	///<When used with a BC1 texture, will force the texture to have an alpha. Ignored otherwise.
+		FORCE_ARRAY_TEXTURE			= 0x0004,	///<NOT YET SUPPORTED! The texture will be an array texture even if the depth is not present. Ignored for formats that can't be arrays. Will throw if array textures of that type are not supported (ie: cubemap arrays, 2D arrays for lesser hardware, etc).
+		FORCE_LUMINANCE_FMT			= 0x0008,	///<Red and RG textures will become luminance and luminance/alpha textures in all cases. Exceptions will be thrown if the GL implementation does not support those luminance/alpha formats (ie: is core).
 
-		FORCE_REQUIRED_FORMATS		= 0x0010,	///<Will only get image formats that are required to exist by OpenGL.
-		FORCE_INTEGRAL_FORMAT		= 0x0020,	///<Integer textures are considered integral.
-		FORCE_SIGNED_FORMAT			= 0x0040,	///<Unsigned integer textures are considered signed integers.
-		FORCE_COLOR_RENDERABLE		= 0x0080,	///<Will force the use of formats that are required to be valid render targets. This will add components if necessary, but it will throw if conversion would require fundamentally changing the basic format (from signed to unsigned, compressed textures, etc).
+//Not supported yet.
+//		FORCE_REQUIRED_FMT			= 0x0010,	///<Will only get image formats that are required to exist by OpenGL.
+		FORCE_INTEGRAL_FMT			= 0x0020,	///<Image formats that contain normalized integers will be uploaded as non-normalized integers.
+		FORCE_SIGNED_FMT			= 0x0040,	///<Image formats that contain unsigned integers will be uploaded as signed integers.
+		FORCE_COLOR_RENDERABLE_FMT	= 0x0080,	///<NOT YET SUPPORTED! Will force the use of formats that are required to be valid render targets. This will add components if necessary, but it will throw if conversion would require fundamentally changing the basic format (from signed to unsigned, compressed textures, etc).
 	};
 
+	/**
+	\brief Retrieves the OpenGL internal format for the given image format and bits.
+
+	This function should be used when you want to do the uploading of the texture data
+	yourself.
+
+	\param format The image format of the image data to have a texture created for it.
+	\param forceConvertBits A bitfield containing values from ForcedConvertFlags. These affect how the format is generated.
+
+	\return A GLenum representing the internal OpenGL format.
+
+	\throws TextureGenerationException If the format is invalid, or if the format cannot be used.
+	Also thrown if the format isn't supported yet. This is a base class; the various derived
+	classes of this type are thrown for specific errors.
+	**/
 	unsigned int GetInternalFormat(const ImageFormat &format, unsigned int forceConvertBits);
 
-	struct OpenGLUploadData
+	/**
+	\brief Contains the pixel transfer parameters for OpenGL texture upload functions.
+	**/
+	struct OpenGLPixelTransferParams
 	{
-		unsigned int format;
-		unsigned int type;
-		unsigned int blockByteCount;
+		unsigned int format;			///<The GLenum format value of pixel transfer operations.
+		unsigned int type;				///<The GLenum type value of pixel transfer operations.
+		unsigned int blockByteCount;	///<The size in bytes for blocks in compressed formats. Necessary to compute the size of the pixel data.
 	};
 
-	OpenGLUploadData GetUploadFormatType(const ImageFormat &format, unsigned int forceConvertBits);
+	/**
+	\brief Retrieves the pixel transfer parameters for the given image format.
 
-	//Will not change OpenGL state in the event of an exception.
-	//Will always return a texture-complete texture.
+	This function should be used if you wish to manually upload image data to OpenGL.
+	
+	\param format The image format of the image data to have a texture created for it.
+	\param forceConvertBits A bitfield containing values from ForcedConvertFlags. These affect how the format is generated.
+
+	\return The OpenGL pixel transfer parameters, and a compressed block size field.
+
+	\throws TextureGenerationException If the format is invalid, or if the format cannot be used.
+	Also thrown if the format isn't supported yet. This is a base class; the various derived
+	classes of this type are thrown for specific errors.
+	**/
+	OpenGLPixelTransferParams GetUploadFormatType(const ImageFormat &format, unsigned int forceConvertBits);
+
+	/**
+	\brief Creates a texture object from the given ImageSet, with flags.
+
+	If an exception is thrown, no OpenGL state will be changed. If a texture was created with
+	glGenTextures before the exception was thrown, it will be deleted with glDeleteTextures
+	after. So this function should be completely exception safe.
+	
+	If an exception is not thrown, then the following OpenGL context state will be changed:
+
+	\li All GL_UNPACK state.
+	\li The texture target of the returned texture will have no texture object bound to it.
+
+	\param pImage The image to upload to OpenGL.
+	\param forceConvertBits A bitfield containing values from ForcedConvertFlags.
+
+	\return The created texture. The texture returned will always be texture-complete,
+	with the proper base and max mipmap level set, and reasonable filtering parameters
+	set on it.
+
+	\throws TextureGenerationException If the format is invalid, or if the format cannot be used.
+	Also thrown if the format isn't supported yet. This is a base class; the various derived
+	classes of this type are thrown for specific errors.
+	**/
 	unsigned int CreateTexture(const ImageSet *pImage, unsigned int forceConvertBits);
+
+	/**
+	\brief As CreateTexture(const ImageSet *, unsigned int), but with a texture object provided by the user.
+	
+	The given texture object \em must not have been used at all. You cannot even have
+	bound it to the OpenGL context once. It should be fresh from glGenTextures.
+
+	\throws TextureGenerationException If the format is invalid, or if the format cannot be used.
+	Also thrown if the format isn't supported yet. This is a base class; the various derived
+	classes of this type are thrown for specific errors.
+	**/
 	void CreateTexture(unsigned int textureName, const ImageSet *pImage, unsigned int forceConvertBits);
+	///@}
 }
 
 

glimg/include/glimg/TextureGeneratorExceptions.h

 #ifndef GLIMG_TEXTURE_GENERATOR_EXCEPTIONS_H
 #define GLIMG_TEXTURE_GENERATOR_EXCEPTIONS_H
 
+/**
+\file
+\brief Exceptions for texture generation functions.
+
+**/
+
 #include <exception>
 #include <string>
 
 namespace glimg
 {
+	///\addtogroup module_glimg_exceptions
+	///@{
+
+	///Base class for all exceptions thrown by the texture loaders.
 	class TextureGenerationException : public std::exception
 	{
 	public:
 		std::string message;
 	};
 
+	///Thrown if the image format cannot be used because the OpenGL implementation doesn't support the format.
 	class ImageFormatUnsupportedException : public TextureGenerationException
 	{
 	public:
 		}
 	};
 
+	///Thrown if the texture type that was asked to be created is not supported by this OpenGL implementation.
 	class TextureUnsupportedException : public TextureGenerationException
 	{
 	public:
 		}
 	};
 
+	///Thrown because the texture type is not yet supported by GL Image.
 	class TextureUnexpectedException : public TextureGenerationException
 	{
 	public:
 		}
 	};
 
+	///Thrown when using the FORCE_REQUIRED_FORMATS flag and the format could not be converted to a required one without compromising data.
 	class CannotForceRenderTargetException : public TextureGenerationException
 	{
 	public:
 		}
 	};
 
+	///Thrown if the image format given to a texture conversion routine is invalid.
 	class ImageFormatUnexpectedException : public TextureGenerationException
 	{
 	public:
 			message += msg;
 		}
 	};
-
+	///@}
 }
 
 

glimg/include/glimg/glimg.h

 #ifndef GLIMG_GLIMG_H
 #define GLIMG_GLIMG_H
 
+/**
+\file
+
+\brief Includes everything in the GL Image library.
+**/
+
 #include "ImageSet.h"
 #include "Loaders.h"
+#include "TextureGenerator.h"
+
+/**
+\brief The main GL Image library namespace.
+**/
+namespace glimg
+{
+
+	/**
+	\brief Namespace for all file loaders.
+	**/
+	namespace loaders
+	{
+		
+	}
+}
 
 #endif //GLIMG_GLIMG_H

glimg/source/DdsLoader.cpp

 #include "glimg/ImageCreator.h"
 #include "glimg/DdsLoader.h"
 #include "DdsLoaderInt.h"
+#include "Util.h"
 
 #define ARRAY_COUNT( array ) (sizeof( array ) / (sizeof( array[0] ) * (sizeof( array ) != sizeof(void*) || sizeof( array[0] ) <= sizeof(void*))))
 
 				//Check the bitcounts, not the fourCC.
 				if(header.ddspf.dwRGBBitCount != ddsFmt.bitDepth)
 					return false;
-				if(ddsFmt.rBitmask && header.ddspf.dwRBitMask != ddsFmt.rBitmask)
+				if((ddsFmt.rBitmask & header.ddspf.dwRBitMask) != ddsFmt.rBitmask)
 					return false;
-				if(ddsFmt.gBitmask && header.ddspf.dwGBitMask != ddsFmt.gBitmask)
+				if((ddsFmt.gBitmask & header.ddspf.dwGBitMask) != ddsFmt.gBitmask)
 					return false;
-				if(ddsFmt.bBitmask && header.ddspf.dwBBitMask != ddsFmt.bBitmask)
+				if((ddsFmt.bBitmask & header.ddspf.dwBBitMask) != ddsFmt.bBitmask)
 					return false;
-				if(ddsFmt.aBitmask && header.ddspf.dwABitMask != ddsFmt.aBitmask)
+				if((ddsFmt.aBitmask & header.ddspf.dwABitMask) != ddsFmt.aBitmask)
 					return false;
 			}
 
 		size_t GetImageByteSize(const ImageFormat &fmt, const glimg::Dimensions &dims,
 			int mipmapLevel);
 
+		//Computes the bytesize of a single scanline of an image of the given format,
+		//with the given line width.
+		//For compressed textures, the value returned is the number of bytes for every
+		//4 scanlines.
+		size_t CalcLineSize(const ImageFormat &fmt, int lineWidth)
+		{
+			//This is from the DDS suggestions for line size computations.
+			if(fmt.eBitdepth == BD_COMPRESSED)
+			{
+				size_t blockSize = 16;
+
+				if(fmt.eType == DT_COMPRESSED_BC1 ||
+					fmt.eType == DT_COMPRESSED_UNSIGNED_BC4 || fmt.eType == DT_COMPRESSED_SIGNED_BC4)
+					blockSize = 8;
+
+				return ((lineWidth + 3) / 4) * blockSize;
+			}
+
+			size_t bytesPerPixel = CalcBytesPerPixel(fmt);
+			return lineWidth * bytesPerPixel;
+		}
+
+		//Computes the offset from the first image.
+		size_t CalcByteOffsetToImage(const ImageFormat &fmt, const glimg::Dimensions &dims,
+			int mipmapLevel, int faceIx, int arrayIx)
+		{
+			//TODO: remove
+			if(faceIx != 0 || arrayIx != 0)
+				throw DdsFileUnsupportedException("", "Cubemaps/array textures not yet supported.");
+
+			size_t currOffset = 0;
+
+			for(int currLevel = 0; currLevel < mipmapLevel; currLevel++)
+			{
+				glimg::Dimensions mipmapDims = ModifySizeForMipmap(dims, currLevel);
+
+				size_t lineSize = CalcLineSize(fmt, mipmapDims.width);
+
+				int effectiveHeight = 1;
+				if(mipmapDims.numDimensions > 1)
+				{
+					effectiveHeight = mipmapDims.height;
+					if(fmt.eBitdepth == BD_COMPRESSED)
+						effectiveHeight = (effectiveHeight + 3) / 4;
+				}
+
+				int effectiveDepth = 1;
+				if(mipmapDims.numDimensions > 2)
+				{
+					effectiveDepth = mipmapDims.depth;
+					if(fmt.eBitdepth == BD_COMPRESSED)
+						effectiveDepth = (effectiveDepth + 3) / 4;
+				}
+
+				int numLines = effectiveHeight * effectiveDepth;
+				currOffset += numLines * lineSize;
+			}
+
+			return currOffset;
+		}
+
 		//Takes ownership of ddsData;
 		ImageSet *ProcessDDSData(FileBuffer &ddsData, const std::string &filename = std::string())
 		{
 			std::vector<size_t> imageOffsets;
 			imageOffsets.reserve(numMipmaps * numArrays * numFaces);
 
-			//Temporary.
-			if(numMipmaps != 1 || numArrays != 1 || numFaces != 1)
+			//TODO: remove
+			if(numArrays != 1 || numFaces != 1)
 				throw DdsFileUnsupportedException(filename, "foo");
 
-			imageOffsets.push_back(baseOffset);
-
+			for(int mipmapLevel = 0; mipmapLevel < numMipmaps; mipmapLevel++)
+			{
+				size_t offsetFromFirstImg = CalcByteOffsetToImage(fmt, dims, mipmapLevel, 0, 0);
+				imageOffsets.push_back(baseOffset + offsetFromFirstImg);
+			}
 
 			//Build the image creator. No more exceptions, except for those thrown by.
 			//the ImageCreator.

glimg/source/ImageFormat.cpp

 
 #include "glimg/ImageFormat.h"
+#include "Util.h"
 
 #define ARRAY_COUNT( array ) (sizeof( array ) / (sizeof( array[0] ) * (sizeof( array ) != sizeof(void*) || sizeof( array[0] ) <= sizeof(void*))))
 
 			return false;
 		}
 
-		BaseDataFormat g_alphaFormats[] = {FMT_COLOR_RGBA, FMT_COLOR_RGBA_sRGB};
-		BaseDataFormat g_rgbFormats[] = {FMT_COLOR_RGB, FMT_COLOR_RGB_sRGB};
+		PixelComponents g_alphaFormats[] = {FMT_COLOR_RGBA, FMT_COLOR_RGBA_sRGB};
+		PixelComponents g_rgbFormats[] = {FMT_COLOR_RGB, FMT_COLOR_RGB_sRGB};
 		Bitdepth g_floatBitdepths[] = {BD_PER_COMP_16, BD_PER_COMP_32, BD_PACKED_32_BIT_101111_REV};
 		Bitdepth g_threeCompBitdepths[] = {BD_PACKED_16_BIT_565, BD_PACKED_16_BIT_565_REV};
-		BaseDataFormat g_colorFormats[] = {FMT_COLOR_RED, FMT_COLOR_RG, FMT_COLOR_RGB,
+		PixelComponents g_colorFormats[] = {FMT_COLOR_RED, FMT_COLOR_RG, FMT_COLOR_RGB,
 			FMT_COLOR_RGBX, FMT_COLOR_RGBA, FMT_COLOR_RGB_sRGB, FMT_COLOR_RGBX_sRGB, FMT_COLOR_RGBA_sRGB};
-		BaseDataFormat g_srgbFormats[] = {FMT_COLOR_RGB_sRGB, FMT_COLOR_RGBX_sRGB, FMT_COLOR_RGBA_sRGB};
+		PixelComponents g_srgbFormats[] = {FMT_COLOR_RGB_sRGB, FMT_COLOR_RGBX_sRGB, FMT_COLOR_RGBA_sRGB};
 
-		BaseDataFormat g_twoCompFormats[] = {FMT_COLOR_RG, FMT_DEPTH_X};
-		BaseDataFormat g_threeCompFormats[] = {FMT_COLOR_RGB, FMT_COLOR_RGB_sRGB};
-		BaseDataFormat g_fourCompFormats[] = {FMT_COLOR_RGBX, FMT_COLOR_RGBA,
-			FMT_COLOR_RGBX_sRGB, FMT_COLOR_RGBA_sRGB};
-
-		int ComponentCount(BaseDataFormat eFormat)
-		{
-			if(IsOneOfThese<ARRAY_COUNT(g_twoCompFormats)>(eFormat, g_twoCompFormats))
-				return 2;
-
-			if(IsOneOfThese<ARRAY_COUNT(g_threeCompFormats)>(eFormat, g_threeCompFormats))
-				return 3;
-
-			if(IsOneOfThese<ARRAY_COUNT(g_fourCompFormats)>(eFormat, g_fourCompFormats))
-				return 4;
-
-			return 1;
-		}
 	}
 
 	bool ImageFormat::ValidateFormat() const

glimg/source/ImageSet.cpp

 
 namespace glimg
 {
-	Image::Image( const detail::ImageSetImpl *pImpl, int arrayIx, int faceIx, int mipmapLevel )
+	SingleImage::SingleImage( const detail::ImageSetImpl *pImpl, int arrayIx, int faceIx, int mipmapLevel )
 		: m_pImpl(pImpl)
 		, m_arrayIx(arrayIx)
 		, m_faceIx(faceIx)
 		, m_mipmapLevel(mipmapLevel)
 	{}
 
-	Image::~Image()
+	SingleImage::~SingleImage()
 	{}
 
-	glimg::Dimensions Image::GetDimensions() const
+	glimg::Dimensions SingleImage::GetDimensions() const
 	{
 		return m_pImpl->GetDimensions(m_mipmapLevel);
 	}
 
-	glimg::ImageFormat Image::GetFormat() const
+	glimg::ImageFormat SingleImage::GetFormat() const
 	{
 		return m_pImpl->GetFormat();
 	}
 
-	const void * Image::GetImageData() const
+	const void * SingleImage::GetImageData() const
 	{
 		const detail::MipmapLevel &mipmapData = m_pImpl->GetMipmapLevel(m_mipmapLevel);
 
 		return m_pImpl->GetFormat();
 	}
 
-	Image * ImageSet::GetImage( int ixMipmapLevel, int ixArray, int ixFace ) const
+	SingleImage * ImageSet::GetImage( int ixMipmapLevel, int ixArray, int ixFace ) const
 	{
-		return new Image(m_pImpl, ixArray, ixFace, ixMipmapLevel);
+		return new SingleImage(m_pImpl, ixArray, ixFace, ixMipmapLevel);
 	}
 }
 

glimg/source/ImageSetImpl.cpp

 
 #include "ImageSetImpl.h"
+#include "Util.h"
 
 namespace glimg
 {
-	namespace
-	{
-		Dimensions ModifySizeForMipmap(Dimensions origDim, int mipmapLevel)
-		{
-			for(int iLoop = 0; iLoop < mipmapLevel; iLoop++)
-			{
-				origDim.width /= 2;
-				origDim.height /= 2;
-				origDim.depth /= 2;
-			}
-
-			return origDim;
-		}
-	}
-
-
 	detail::ImageSetImpl::ImageSetImpl( MemoryObject *pObject, Dimensions dimensions,
 		int arrayCount, int mipmapCount, int faceCount,
 		ImageFormat format, std::vector<MipmapLevel> &swapThisIn )

glimg/source/OldDdsFmtConv.inc

 {{DT_NORM_UNSIGNED_INTEGER, FMT_COLOR_RGBA, ORDER_RGBA, BD_PER_COMP_8, 1},
 {DDPF_RGB | DDPF_ALPHAPIXELS, 32, 0xff, 0xff00, 0xff0000, 0xff000000, 0}},
 
+{{DT_NORM_UNSIGNED_INTEGER, FMT_COLOR_RGBA, ORDER_BGRA, BD_PACKED_32_BIT_8888_REV, 1},
+{DDPF_RGB | DDPF_ALPHAPIXELS, 32, 0xff0000, 0xff00, 0xff, 0xff000000, 0}},
+
 {{DT_NORM_UNSIGNED_INTEGER, FMT_COLOR_RGBX, ORDER_RGBA, BD_PER_COMP_8, 1},
 {DDPF_RGB, 32, 0xff, 0xff00, 0xff0000, 0, 0}},
 

glimg/source/TextureGenerator.cpp

 
 		void ThrowIfForceRendertarget(unsigned int forceConvertBits)
 		{
-			if(forceConvertBits & FORCE_COLOR_RENDERABLE)
+			if(forceConvertBits & FORCE_COLOR_RENDERABLE_FMT)
 				throw CannotForceRenderTargetException();
 		}
 
 		int ComponentCount(const ImageFormat &format, unsigned int forceConvertBits)
 		{
 			//TODO: Forceconv.
-			BaseDataFormat twoCompFormats[] = {FMT_COLOR_RG, FMT_DEPTH_X};
-			BaseDataFormat threeCompFormats[] = {FMT_COLOR_RGB, FMT_COLOR_RGB_sRGB};
-			BaseDataFormat fourCompFormats[] = {FMT_COLOR_RGBX, FMT_COLOR_RGBA,
+			PixelComponents twoCompFormats[] = {FMT_COLOR_RG, FMT_DEPTH_X};
+			PixelComponents threeCompFormats[] = {FMT_COLOR_RGB, FMT_COLOR_RGB_sRGB};
+			PixelComponents fourCompFormats[] = {FMT_COLOR_RGBX, FMT_COLOR_RGBA,
 				FMT_COLOR_RGBX_sRGB, FMT_COLOR_RGBA_sRGB};
 
 			if(IsOneOfThese<ARRAY_COUNT(twoCompFormats)>(format.eFormat, twoCompFormats))
 
 		bool IsSRGBFormat(const ImageFormat &format, unsigned int forceConvertBits)
 		{
-			BaseDataFormat srgbFormats[] = {FMT_COLOR_RGB_sRGB, FMT_COLOR_RGBX_sRGB, FMT_COLOR_RGBA_sRGB};
+			PixelComponents srgbFormats[] = {FMT_COLOR_RGB_sRGB, FMT_COLOR_RGBX_sRGB, FMT_COLOR_RGBA_sRGB};
 			if(IsOneOfThese<ARRAY_COUNT(srgbFormats)>(format.eFormat, srgbFormats))
 				return true;
 
-			if(!(forceConvertBits & FORCE_SRGB_COLORSPACE))
+			if(!(forceConvertBits & FORCE_SRGB_COLORSPACE_FMT))
 				return false;
 
-			BaseDataType srgbTypes[] = {DT_NORM_UNSIGNED_INTEGER,
+			PixelDataType srgbTypes[] = {DT_NORM_UNSIGNED_INTEGER,
 				DT_COMPRESSED_BC1, DT_COMPRESSED_BC2, DT_COMPRESSED_BC3, DT_COMPRESSED_BC7};
 
 			if(IsOneOfThese<ARRAY_COUNT(srgbTypes)>(format.eType, srgbTypes))
 				return false;
 
 			//unsigned normalized integers. Check for RGB or RGBA components.
-			BaseDataFormat convertableFormats[] = {FMT_COLOR_RGB, FMT_COLOR_RGBX, FMT_COLOR_RGBA};
+			PixelComponents convertableFormats[] = {FMT_COLOR_RGB, FMT_COLOR_RGBX, FMT_COLOR_RGBA};
 			if(IsOneOfThese<ARRAY_COUNT(convertableFormats)>(format.eFormat, convertableFormats))
 				return true;
 
 		bool FormatHasAlpha(const ImageFormat &format, unsigned int forceConvertBits)
 		{
 			//TODO: Forceconv. Check for color renderable.
-			BaseDataFormat alphaFormats[] = {FMT_COLOR_RGBA, FMT_COLOR_RGBA_sRGB};
+			PixelComponents alphaFormats[] = {FMT_COLOR_RGBA, FMT_COLOR_RGBA_sRGB};
 			if(IsOneOfThese<ARRAY_COUNT(alphaFormats)>(format.eFormat, alphaFormats))
 				return true;
 
 
 		bool UseLAInsteadOfRG(unsigned int forceConvertBits)
 		{
-			if(forceConvertBits & FORCE_LUMINANCE_FORMATS)
+			if(forceConvertBits & FORCE_LUMINANCE_FMT)
 				return true;
 
 			try
 			return false;
 		}
 
-		BaseDataType GetDataType(const ImageFormat &format, unsigned int forceConvertBits)
+		PixelDataType GetDataType(const ImageFormat &format, unsigned int forceConvertBits)
 		{
-			bool bForceIntegral = (forceConvertBits & FORCE_INTEGRAL_FORMAT) != 0;
-			bool bForceSigned = (forceConvertBits & FORCE_SIGNED_FORMAT) != 0;
+			bool bForceIntegral = (forceConvertBits & FORCE_INTEGRAL_FMT) != 0;
+			bool bForceSigned = (forceConvertBits & FORCE_SIGNED_FMT) != 0;
 			if(!bForceIntegral && !bForceSigned)
 				return format.eType;
 
 
 		unsigned int GetStandardOpenGLFormat( const ImageFormat &format, unsigned int forceConvertBits )
 		{
-			BaseDataType eType = GetDataType(format, forceConvertBits);
+			PixelDataType eType = GetDataType(format, forceConvertBits);
 
 			switch(eType)
 			{
 				if(IsSRGBFormat(format, forceConvertBits))
 				{
 					ThrowIfEXT_SRGBNotSupported();
-					if(forceConvertBits & FORCE_BC1_ALPHA_TEXTURE)
+					if(forceConvertBits & FORCE_BC1_ALPHA_FMT)
 						return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
 					else
 					{
 				}
 				else
 				{
-					if(forceConvertBits & FORCE_BC1_ALPHA_TEXTURE)
+					if(forceConvertBits & FORCE_BC1_ALPHA_FMT)
 						return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
 					else
 					{
 #define ONE_SNORM_LA(size, suffix) GL_LUMINANCE ## size ## suffix
 #define TWO_SNORM_LA(size, suffix) GL_LUMINANCE ## size ## _ALPHA ## size ## suffix
 
-	unsigned int GetOpenGLType( const ImageFormat &format, OpenGLUploadData &ret, BaseDataType eType, GLenum g_packedTypes );
+	unsigned int GetOpenGLType( const ImageFormat &format, OpenGLPixelTransferParams &ret, PixelDataType eType, GLenum g_packedTypes );
 	unsigned int GetInternalFormat( const ImageFormat &format, unsigned int forceConvertBits )
 	{
 		{
 	/// UPLOAD FORMAT AND TYPE.
 	namespace
 	{
-		bool IsTypeSigned(BaseDataType eType)
+		bool IsTypeSigned(PixelDataType eType)
 		{
-			BaseDataType signedIntegerFormats[] = {DT_SIGNED_INTEGRAL, DT_NORM_SIGNED_INTEGER};
+			PixelDataType signedIntegerFormats[] = {DT_SIGNED_INTEGRAL, DT_NORM_SIGNED_INTEGER};
 			return IsOneOfThese<ARRAY_COUNT(signedIntegerFormats)>(eType, signedIntegerFormats);
 		}
 
-		bool IsTypeIntegral(BaseDataType eType)
+		bool IsTypeIntegral(PixelDataType eType)
 		{
-			BaseDataType integralIntegerFormats[] = {DT_SIGNED_INTEGRAL, DT_UNSIGNED_INTEGRAL};
+			PixelDataType integralIntegerFormats[] = {DT_SIGNED_INTEGRAL, DT_UNSIGNED_INTEGRAL};
 			return IsOneOfThese<ARRAY_COUNT(integralIntegerFormats)>(eType, integralIntegerFormats);
 		}
 
 			GL_UNSIGNED_INT_5_9_9_9_REV,		//BD_PACKED_32_BIT_5999_REV
 		};
 
-		GLenum GetOpenGLType( const ImageFormat &format, BaseDataType eType, unsigned int forceConvertBits )
+		GLenum GetOpenGLType( const ImageFormat &format, PixelDataType eType, unsigned int forceConvertBits )
 		{
 			switch(format.eBitdepth)
 			{
 			GL_RGBA,				GL_RGBA_INTEGER,	//FMT_COLOR_RGBA_sRGB
 		};
 
-		GLenum GetOpenGLFormat(const ImageFormat &format, BaseDataType eType, unsigned int forceConvertBits)
+		GLenum GetOpenGLFormat(const ImageFormat &format, PixelDataType eType, unsigned int forceConvertBits)
 		{
 			if(format.eFormat == FMT_DEPTH)
 			{
 		}
 	}
 
-	OpenGLUploadData GetUploadFormatType( const ImageFormat &format, unsigned int forceConvertBits )
+	OpenGLPixelTransferParams GetUploadFormatType( const ImageFormat &format, unsigned int forceConvertBits )
 	{
 		{
 			const std::string & msg = format.ValidateFormatText();
 				throw ImageFormatUnexpectedException(msg);
 		}
 
-		OpenGLUploadData ret;
+		OpenGLPixelTransferParams ret;
 		ret.type = 0xFFFFFFFF;
 		ret.format = 0xFFFFFFFF;
 		ret.blockByteCount = 0;
 
-		BaseDataType eType = GetDataType(format, forceConvertBits);
+		PixelDataType eType = GetDataType(format, forceConvertBits);
 		if(eType >= DT_NUM_UNCOMPRESSED_TYPES)
 		{
 			switch(eType)
 			//Too old to bother checking.
 		}
 
-		GLuint CalcCompressedImageSize(GLuint width, GLuint height, const OpenGLUploadData &upload)
+		GLuint CalcCompressedImageSize(GLuint width, GLuint height, const OpenGLPixelTransferParams &upload)
 		{
 			GLuint columnCount = (width + 3) / 4;
 			GLuint rowCount = (height + 3) / 4;
 		}
 
 		void TexImage1D(GLenum texTarget, GLuint mipmap, GLuint internalFormat,
-			GLuint width, const OpenGLUploadData &upload, const void *pPixelData)
+			GLuint width, const OpenGLPixelTransferParams &upload, const void *pPixelData)
 		{
 			if(upload.blockByteCount)
 			{
 		}
 
 		void TexImage2D(GLenum texTarget, GLuint mipmap, GLuint internalFormat,
-			GLuint width, GLuint height, const OpenGLUploadData &upload, const void *pPixelData)
+			GLuint width, GLuint height, const OpenGLPixelTransferParams &upload, const void *pPixelData)
 		{
 			if(upload.blockByteCount)
 			{
 		}
 
 		void TexImage3D(GLenum texTarget, GLuint mipmap, GLuint internalFormat,
-			GLuint width, GLuint height, GLuint depth, const OpenGLUploadData &upload,
+			GLuint width, GLuint height, GLuint depth, const OpenGLPixelTransferParams &upload,
 			const void *pPixelData)
 		{
 			if(upload.blockByteCount)
 		}
 
 		void Build1DArrayTexture(unsigned int textureName, const detail::ImageSetImpl *pImage,
-			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLUploadData &upload)
+			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLPixelTransferParams &upload)
 		{
 			ThrowIfArrayTextureNotSupported();
 			throw TextureUnexpectedException();
 		}
 
 		void Build1DTexture(unsigned int textureName, const detail::ImageSetImpl *pImage,
-			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLUploadData &upload)
+			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLPixelTransferParams &upload)
 		{
 			SetupUploadState(pImage->GetFormat(), forceConvertBits);
 			glBindTexture(GL_TEXTURE_1D, textureName);
 		}
 
 		void Build2DCubeArrayTexture(unsigned int textureName, const detail::ImageSetImpl *pImage,
-			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLUploadData &upload)
+			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLPixelTransferParams &upload)
 		{
 			ThrowIfArrayTextureNotSupported();
 			ThrowIfCubeArrayTextureNotSupported();
 		}
 
 		void Build2DArrayTexture(unsigned int textureName, const detail::ImageSetImpl *pImage,
-			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLUploadData &upload)
+			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLPixelTransferParams &upload)
 		{
 			ThrowIfArrayTextureNotSupported();
 			throw TextureUnexpectedException();
 		}
 
 		void Build2DCubeTexture(unsigned int textureName, const detail::ImageSetImpl *pImage,
-			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLUploadData &upload)
+			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLPixelTransferParams &upload)
 		{
 			ThrowIfCubeTextureNotSupported();
 			throw TextureUnexpectedException();
 		}
 
 		void Build2DTexture(unsigned int textureName, const detail::ImageSetImpl *pImage,
-			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLUploadData &upload)
+			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLPixelTransferParams &upload)
 		{
 			SetupUploadState(pImage->GetFormat(), forceConvertBits);
 			glBindTexture(GL_TEXTURE_2D, textureName);
 		}
 
 		void Build3DTexture(unsigned int textureName, const detail::ImageSetImpl *pImage,
-			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLUploadData &upload)
+			unsigned int forceConvertBits, GLuint internalFormat, const OpenGLPixelTransferParams &upload)
 		{
 			SetupUploadState(pImage->GetFormat(), forceConvertBits);
 			glBindTexture(GL_TEXTURE_3D, textureName);
 	{
 		const ImageFormat &format = pImage->GetFormat();
 		GLuint internalFormat = GetInternalFormat(format, forceConvertBits);
-		OpenGLUploadData upload = GetUploadFormatType(format, forceConvertBits);
+		OpenGLPixelTransferParams upload = GetUploadFormatType(format, forceConvertBits);
 
 		Dimensions dims = pImage->GetDimensions();
 
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.