mirror of https://github.com/mosra/magnum.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
163 lines
8.2 KiB
163 lines
8.2 KiB
|
8 years ago
|
#ifndef Magnum_GL_Implementation_TextureState_h
|
||
|
|
#define Magnum_GL_Implementation_TextureState_h
|
||
|
14 years ago
|
/*
|
||
|
|
This file is part of Magnum.
|
||
|
|
|
||
|
8 years ago
|
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
|
||
|
12 years ago
|
Vladimír Vondruš <mosra@centrum.cz>
|
||
|
13 years ago
|
|
||
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||
|
|
copy of this software and associated documentation files (the "Software"),
|
||
|
|
to deal in the Software without restriction, including without limitation
|
||
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
||
|
|
Software is furnished to do so, subject to the following conditions:
|
||
|
|
|
||
|
|
The above copyright notice and this permission notice shall be included
|
||
|
|
in all copies or substantial portions of the Software.
|
||
|
|
|
||
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||
|
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||
|
|
DEALINGS IN THE SOFTWARE.
|
||
|
14 years ago
|
*/
|
||
|
|
|
||
|
12 years ago
|
#include <string>
|
||
|
13 years ago
|
#include <vector>
|
||
|
10 years ago
|
#include <Corrade/Containers/Array.h>
|
||
|
13 years ago
|
|
||
|
10 years ago
|
#include "Magnum/Magnum.h"
|
||
|
8 years ago
|
#include "Magnum/GL/GL.h"
|
||
|
|
#include "Magnum/GL/OpenGL.h"
|
||
|
14 years ago
|
|
||
|
9 years ago
|
#ifdef _MSC_VER
|
||
|
8 years ago
|
#include "Magnum/GL/AbstractTexture.h"
|
||
|
9 years ago
|
|
||
|
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
11 years ago
|
/* Otherwise the member function pointers will have different size based on
|
||
|
|
whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND
|
||
|
|
IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */
|
||
|
8 years ago
|
#include "Magnum/GL/BufferTexture.h"
|
||
|
|
#include "Magnum/GL/CubeMapTexture.h"
|
||
|
11 years ago
|
#endif
|
||
|
9 years ago
|
#endif
|
||
|
11 years ago
|
|
||
|
14 years ago
|
namespace Magnum { namespace Implementation {
|
||
|
|
|
||
|
|
struct TextureState {
|
||
|
12 years ago
|
explicit TextureState(Context& context, std::vector<std::string>& extensions);
|
||
|
13 years ago
|
~TextureState();
|
||
|
14 years ago
|
|
||
|
12 years ago
|
void reset();
|
||
|
|
|
||
|
10 years ago
|
Int(*compressedBlockDataSizeImplementation)(GLenum, TextureFormat);
|
||
|
12 years ago
|
void(*unbindImplementation)(GLint);
|
||
|
11 years ago
|
void(*bindMultiImplementation)(GLint, Containers::ArrayView<AbstractTexture* const>);
|
||
|
12 years ago
|
void(AbstractTexture::*createImplementation)();
|
||
|
12 years ago
|
void(AbstractTexture::*bindImplementation)(GLint);
|
||
|
|
void(AbstractTexture::*parameteriImplementation)(GLenum, GLint);
|
||
|
|
void(AbstractTexture::*parameterfImplementation)(GLenum, GLfloat);
|
||
|
12 years ago
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
|
void(AbstractTexture::*parameterivImplementation)(GLenum, const GLint*);
|
||
|
|
#endif
|
||
|
12 years ago
|
void(AbstractTexture::*parameterfvImplementation)(GLenum, const GLfloat*);
|
||
|
11 years ago
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
|
||
|
12 years ago
|
void(AbstractTexture::*parameterIuivImplementation)(GLenum, const GLuint*);
|
||
|
|
void(AbstractTexture::*parameterIivImplementation)(GLenum, const GLint*);
|
||
|
12 years ago
|
#endif
|
||
|
12 years ago
|
void(AbstractTexture::*setMaxAnisotropyImplementation)(GLfloat);
|
||
|
11 years ago
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
|
||
|
10 years ago
|
void(AbstractTexture::*getLevelParameterivImplementation)(GLint, GLenum, GLint*);
|
||
|
12 years ago
|
#endif
|
||
|
12 years ago
|
void(AbstractTexture::*mipmapImplementation)();
|
||
|
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
12 years ago
|
void(AbstractTexture::*storage1DImplementation)(GLsizei, TextureFormat, const Math::Vector<1, GLsizei>&);
|
||
|
12 years ago
|
#endif
|
||
|
12 years ago
|
void(AbstractTexture::*storage2DImplementation)(GLsizei, TextureFormat, const Vector2i&);
|
||
|
11 years ago
|
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
|
||
|
12 years ago
|
void(AbstractTexture::*storage3DImplementation)(GLsizei, TextureFormat, const Vector3i&);
|
||
|
11 years ago
|
#endif
|
||
|
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
|
||
|
12 years ago
|
void(AbstractTexture::*storage2DMultisampleImplementation)(GLsizei, TextureFormat, const Vector2i&, GLboolean);
|
||
|
11 years ago
|
void(AbstractTexture::*storage3DMultisampleImplementation)(GLsizei, TextureFormat, const Vector3i&, GLboolean);
|
||
|
12 years ago
|
#endif
|
||
|
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
11 years ago
|
void(AbstractTexture::*getImageImplementation)(GLint, PixelFormat, PixelType, std::size_t, GLvoid*);
|
||
|
11 years ago
|
void(AbstractTexture::*getCompressedImageImplementation)(GLint, std::size_t, GLvoid*);
|
||
|
12 years ago
|
#endif
|
||
|
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
11 years ago
|
void(AbstractTexture::*subImage1DImplementation)(GLint, const Math::Vector<1, GLint>&, const Math::Vector<1, GLsizei>&, PixelFormat, PixelType, const GLvoid*);
|
||
|
11 years ago
|
void(AbstractTexture::*compressedSubImage1DImplementation)(GLint, const Math::Vector<1, GLint>&, const Math::Vector<1, GLsizei>&, CompressedPixelFormat, const GLvoid*, GLsizei);
|
||
|
12 years ago
|
#endif
|
||
|
9 years ago
|
void (AbstractTexture::*image2DImplementation)(GLenum, GLint, TextureFormat, const Vector2i&, PixelFormat, PixelType, const GLvoid*, const PixelStorage&);
|
||
|
|
void(AbstractTexture::*subImage2DImplementation)(GLint, const Vector2i&, const Vector2i&, PixelFormat, PixelType, const GLvoid*, const PixelStorage&);
|
||
|
11 years ago
|
void(AbstractTexture::*compressedSubImage2DImplementation)(GLint, const Vector2i&, const Vector2i&, CompressedPixelFormat, const GLvoid*, GLsizei);
|
||
|
11 years ago
|
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
|
||
|
9 years ago
|
void (AbstractTexture::*image3DImplementation)(GLint, TextureFormat, const Vector3i&, PixelFormat, PixelType, const GLvoid*, const PixelStorage&);
|
||
|
|
void(AbstractTexture::*subImage3DImplementation)(GLint, const Vector3i&, const Vector3i&, PixelFormat, PixelType, const GLvoid*, const PixelStorage&);
|
||
|
11 years ago
|
void(AbstractTexture::*compressedSubImage3DImplementation)(GLint, const Vector3i&, const Vector3i&, CompressedPixelFormat, const GLvoid*, GLsizei);
|
||
|
11 years ago
|
#endif
|
||
|
12 years ago
|
void(AbstractTexture::*invalidateImageImplementation)(GLint);
|
||
|
|
void(AbstractTexture::*invalidateSubImageImplementation)(GLint, const Vector3i&, const Vector3i&);
|
||
|
|
|
||
|
11 years ago
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
|
||
|
12 years ago
|
void(BufferTexture::*setBufferImplementation)(BufferTextureFormat, Buffer&);
|
||
|
|
void(BufferTexture::*setBufferRangeImplementation)(BufferTextureFormat, Buffer&, GLintptr, GLsizeiptr);
|
||
|
|
#endif
|
||
|
|
|
||
|
10 years ago
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
|
||
|
|
void(CubeMapTexture::*getCubeLevelParameterivImplementation)(GLint, GLenum, GLint*);
|
||
|
|
#endif
|
||
|
12 years ago
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
10 years ago
|
GLint(CubeMapTexture::*getCubeLevelCompressedImageSizeImplementation)(GLint);
|
||
|
10 years ago
|
void(CubeMapTexture::*getCubeImageImplementation)(CubeMapCoordinate, GLint, const Vector2i&, PixelFormat, PixelType, std::size_t, GLvoid*);
|
||
|
10 years ago
|
void(CubeMapTexture::*getFullCompressedCubeImageImplementation)(GLint, const Vector2i&, std::size_t, std::size_t, GLvoid*);
|
||
|
10 years ago
|
void(CubeMapTexture::*getCompressedCubeImageImplementation)(CubeMapCoordinate, GLint, const Vector2i&, std::size_t, GLvoid*);
|
||
|
9 years ago
|
void(CubeMapTexture::*cubeSubImage3DImplementation)(GLint, const Vector3i&, const Vector3i&, PixelFormat, PixelType, const GLvoid*, const PixelStorage&);
|
||
|
12 years ago
|
#endif
|
||
|
10 years ago
|
void(CubeMapTexture::*cubeSubImageImplementation)(CubeMapCoordinate, GLint, const Vector2i&, const Vector2i&, PixelFormat, PixelType, const GLvoid*);
|
||
|
|
void(CubeMapTexture::*cubeCompressedSubImageImplementation)(CubeMapCoordinate, GLint, const Vector2i&, const Vector2i&, CompressedPixelFormat, const GLvoid*, GLsizei);
|
||
|
12 years ago
|
|
||
|
12 years ago
|
GLint maxSize,
|
||
|
11 years ago
|
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
|
||
|
12 years ago
|
max3DSize,
|
||
|
11 years ago
|
#endif
|
||
|
12 years ago
|
maxCubeMapSize;
|
||
|
12 years ago
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
|
GLint maxArrayLayers;
|
||
|
|
#endif
|
||
|
12 years ago
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
11 years ago
|
GLint maxRectangleSize;
|
||
|
|
#endif
|
||
|
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
|
||
|
|
GLint maxBufferSize;
|
||
|
12 years ago
|
#endif
|
||
|
12 years ago
|
GLint maxTextureUnits;
|
||
|
12 years ago
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
12 years ago
|
GLfloat maxLodBias;
|
||
|
|
#endif
|
||
|
|
GLfloat maxMaxAnisotropy;
|
||
|
12 years ago
|
GLint currentTextureUnit;
|
||
|
12 years ago
|
#ifndef MAGNUM_TARGET_GLES2
|
||
|
13 years ago
|
GLint maxColorSamples,
|
||
|
|
maxDepthSamples,
|
||
|
12 years ago
|
maxIntegerSamples;
|
||
|
|
#endif
|
||
|
11 years ago
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
|
||
|
12 years ago
|
GLint bufferOffsetAlignment;
|
||
|
13 years ago
|
#endif
|
||
|
14 years ago
|
|
||
|
10 years ago
|
Containers::Array<std::pair<GLenum, GLuint>> bindings;
|
||
|
10 years ago
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
|
||
|
10 years ago
|
/* Texture object ID, level, layered, layer, access */
|
||
|
10 years ago
|
Containers::Array<std::tuple<GLuint, GLint, GLboolean, GLint, GLenum>> imageBindings;
|
||
|
|
#endif
|
||
|
14 years ago
|
};
|
||
|
|
|
||
|
|
}}
|
||
|
|
|
||
|
|
#endif
|