4#ifndef QABSTRACTOPENGLTEXTURE_P_H
5#define QABSTRACTOPENGLTEXTURE_P_H
20#include <QtOpenGL/qtopenglglobal.h>
21#include "private/qobject_p.h"
28inline double qLog2(
const double x)
30 return std::log(x) /
std::log(2.0);
38class QOpenGLFunctions;
47 Q_DECLARE_PUBLIC(QOpenGLTexture)
62 void allocateStorage(QOpenGLTexture::PixelFormat pixelFormat, QOpenGLTexture::PixelType pixelType);
65 void setData(
int mipLevel,
int layer,
int layerCount, QOpenGLTexture::CubeMapFace cubeFace,
66 QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType,
67 const void *data,
const QOpenGLPixelTransferOptions *
const options);
68 void setData(
int xOffset,
int yOffset,
int zOffset,
int width,
int height,
int depth,
69 int mipLevel,
int layer,
int layerCount, QOpenGLTexture::CubeMapFace cubeFace,
70 QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType,
71 const void *data,
const QOpenGLPixelTransferOptions *
const options);
72 void setCompressedData(
int mipLevel,
int layer,
int layerCount, QOpenGLTexture::CubeMapFace cubeFace,
73 int dataSize,
const void *data,
74 const QOpenGLPixelTransferOptions *
const options);
78 void setWrapMode(QOpenGLTexture::CoordinateDirection direction, QOpenGLTexture::WrapMode mode);
82 int minimumMipmapLevel,
int maximumMipmapLevel,
83 int minimumLayer,
int maximumLayer)
const;
94 return std::floor(
double(qMax(1, baseLevelSize >> mipLevel)));
144#undef Q_CALL_MEMBER_FUNCTION
QOpenGLTextureHelper(QOpenGLContext *context)
void setWrapMode(QOpenGLTexture::CoordinateDirection direction, QOpenGLTexture::WrapMode mode)
void allocateStorage(QOpenGLTexture::PixelFormat pixelFormat, QOpenGLTexture::PixelType pixelType)
int evaluateMipLevels() const
void setData(int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options)
void setData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options)
QOpenGLFunctions * functions
bool isUsingImmutableStorage() const
QOpenGLTexturePrivate(QOpenGLTexture::Target textureTarget, QOpenGLTexture *qq)
void allocateImmutableStorage()
void allocateMutableStorage(QOpenGLTexture::PixelFormat pixelFormat, QOpenGLTexture::PixelType pixelType)
void setWrapMode(QOpenGLTexture::WrapMode mode)
int maximumMipLevelCount() const
bool fixedSamplePositions
void release(uint unit, QOpenGLTexture::TextureUnitReset reset=QOpenGLTexture::DontResetTextureUnit)
QOpenGLTexture * createTextureView(QOpenGLTexture::Target target, QOpenGLTexture::TextureFormat viewFormat, int minimumMipmapLevel, int maximumMipmapLevel, int minimumLayer, int maximumLayer) const
void initializeOpenGLFunctions()
bool isBound(uint unit) const
void bind(uint unit, QOpenGLTexture::TextureUnitReset reset=QOpenGLTexture::DontResetTextureUnit)
void setCompressedData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace, int dataSize, const void *data, const QOpenGLPixelTransferOptions *const options)
static int mipLevelSize(int mipLevel, int baseLevelSize)
QOpenGLTextureHelper * texFuncs
Combined button and popup list for selecting options.
#define GL_TEXTURE_COMPARE_FUNC
#define GL_TEXTURE_WRAP_R
#define GL_TEXTURE_BASE_LEVEL
#define GL_TEXTURE_MAX_LEVEL
#define GL_ACTIVE_TEXTURE
#define GL_TEXTURE_COMPARE_MODE
static QOpenGLTexture::PixelFormat pixelFormatCompatibleWithInternalFormat(QOpenGLTexture::TextureFormat internalFormat)
static QOpenGLTexture::PixelType pixelTypeCompatibleWithInternalFormat(QOpenGLTexture::TextureFormat internalFormat)
static bool isNpot(int width, int height=1, int depth=1)
static bool isCompressedFormat(QOpenGLTexture::TextureFormat internalFormat)
static bool isTextureTargetMultisample(QOpenGLTexture::Target target)
static bool isSizedTextureFormat(QOpenGLTexture::TextureFormat internalFormat)