Hide copy ctor and operator to prevent compiler warnings.

Wrap pimpl using NVTT_DECLARE_PIMPL macro.
This commit is contained in:
castano 2008-02-28 21:14:40 +00:00
parent e3e7fcb226
commit dafe2b8841

View File

@ -49,6 +49,14 @@
#define NVTT_VERSION 200 #define NVTT_VERSION 200
#define NVTT_DECLARE_PIMPL(Class) \
private: \
Class(const Class &); \
void operator=(const Class &); \
public: \
struct Private; \
Private & m
// Public interface. // Public interface.
namespace nvtt namespace nvtt
@ -92,6 +100,8 @@ namespace nvtt
/// Compression options. This class describes the desired compression format and other compression settings. /// Compression options. This class describes the desired compression format and other compression settings.
struct CompressionOptions struct CompressionOptions
{ {
NVTT_DECLARE_PIMPL(CompressionOptions);
NVTT_API CompressionOptions(); NVTT_API CompressionOptions();
NVTT_API ~CompressionOptions(); NVTT_API ~CompressionOptions();
@ -107,10 +117,6 @@ namespace nvtt
NVTT_API void setPixelFormat(unsigned int bitcount, unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask); NVTT_API void setPixelFormat(unsigned int bitcount, unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask);
NVTT_API void setQuantization(bool colorDithering, bool alphaDithering, bool binaryAlpha, int alphaThreshold = 127); NVTT_API void setQuantization(bool colorDithering, bool alphaDithering, bool binaryAlpha, int alphaThreshold = 127);
//private:
struct Private;
Private & m;
}; };
@ -173,6 +179,8 @@ namespace nvtt
/// Input options. Specify format and layout of the input texture. /// Input options. Specify format and layout of the input texture.
struct InputOptions struct InputOptions
{ {
NVTT_DECLARE_PIMPL(InputOptions);
NVTT_API InputOptions(); NVTT_API InputOptions();
NVTT_API ~InputOptions(); NVTT_API ~InputOptions();
@ -217,10 +225,6 @@ namespace nvtt
// Set resizing options. // Set resizing options.
NVTT_API void setMaxExtents(int d); NVTT_API void setMaxExtents(int d);
NVTT_API void setRoundMode(RoundMode mode); NVTT_API void setRoundMode(RoundMode mode);
//private:
struct Private;
Private & m;
}; };
@ -261,6 +265,8 @@ namespace nvtt
/// the compressor to the user. /// the compressor to the user.
struct OutputOptions struct OutputOptions
{ {
NVTT_DECLARE_PIMPL(OutputOptions);
NVTT_API OutputOptions(); NVTT_API OutputOptions();
NVTT_API ~OutputOptions(); NVTT_API ~OutputOptions();
@ -272,16 +278,14 @@ namespace nvtt
NVTT_API void setOutputHandler(OutputHandler * outputHandler); NVTT_API void setOutputHandler(OutputHandler * outputHandler);
NVTT_API void setErrorHandler(ErrorHandler * errorHandler); NVTT_API void setErrorHandler(ErrorHandler * errorHandler);
NVTT_API void setOutputHeader(bool outputHeader); NVTT_API void setOutputHeader(bool outputHeader);
//private:
struct Private;
Private & m;
}; };
/// Texture compressor. /// Texture compressor.
struct Compressor struct Compressor
{ {
NVTT_DECLARE_PIMPL(Compressor);
NVTT_API Compressor(); NVTT_API Compressor();
NVTT_API ~Compressor(); NVTT_API ~Compressor();
@ -293,10 +297,6 @@ namespace nvtt
// Estimate the size of compressing the input with the given options. // Estimate the size of compressing the input with the given options.
NVTT_API int estimateSize(const InputOptions & inputOptions, const CompressionOptions & compressionOptions) const; NVTT_API int estimateSize(const InputOptions & inputOptions, const CompressionOptions & compressionOptions) const;
//private:
struct Private;
Private & m;
}; };