28 #ifndef __D3D11TEXTURE_H__ 29 #define __D3D11TEXTURE_H__ 35 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 && !defined(_WIN32_WINNT_WIN8) 36 #ifndef USE_D3DX11_LIBRARY 37 #define USE_D3DX11_LIBRARY 66 template<
typename fromtype,
typename totype>
69 HRESULT hr = from->QueryInterface(__uuidof(totype), (
void **)to);
71 if(FAILED(hr) || mDevice.
isError())
76 "D3D11Texture::_queryInterface" );
80 #ifdef USE_D3DX11_LIBRARY 108 void _loadTex(LoadedStreams & loadedStreams);
135 { assert(face < 6);
return mCubeFaceNames[face]; }
177 { assert(mpTex);
return mpTex; }
RenderTexture implementation for D3D11.
bool mDynamicTextures
The memory pool being used.
~D3D11Texture()
destructor
void _create2DTex()
internal method, create a blank normal 2D texture
void loadImage(const Image &img)
overridden from Texture
void createInternalResources(void)
Creates the internal texture resources for this texture.
bool requiresTextureFlipping() const
LoadedStreams _prepareNormTex()
DXGI_FORMAT mBBPixelFormat
device creation parameters
ID3D11Texture2D * GetTex2D()
void _setFinalAttributes(unsigned long width, unsigned long height, unsigned long depth, PixelFormat format, UINT miscflags)
internal method, set Texture class final texture protected attributes
void _create1DTex()
internal method, create a blank normal 1D Dtexture
String mCubeFaceNames[6]
cube texture individual face names
void _createSurfaceList(void)
internal method, create D3D11HardwarePixelBuffers for every face and mipmap level.
bool releaseIfDefaultPool(void)
For dealing with lost devices - release the resource if in the default pool (and return true) ...
ID3D11Texture2D * mp2DTex
ID3D11Resource * getTextureResource()
ID3D11ShaderResourceView * mpShaderResourceView
PixelFormat
The pixel format used for images, textures, and render surfaces.
String _getCubeFaceName(unsigned char face) const
internal method, the cube map face name for the spec. face index
void _create2DResourceView()
void _queryInterface(fromtype *from, totype **to)
Interface describing a manual resource loader.
LoadedStreams _prepareVolumeTex()
Abstract class representing a Texture resource.
ID3D11RenderTargetView * mRenderTargetView
unsigned long long int ResourceHandle
void _loadTex(LoadedStreams &loadedStreams)
internal method, load a normal texture
const bool isError() const
bool HasAutoMipMapGenerationEnabled() const
LoadedStreams _prepareCubeTex()
void _create1DResourceView()
D3D11Texture(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, D3D11Device &device)
constructor
void copyToTexture(TexturePtr &target)
overridden from Texture
ID3D11Texture3D * mp3DTex
cubic texture pointer
void loadImpl()
overridden from Resource
ID3D11ShaderResourceView * getTexture()
retrieves a pointer to the actual texture
DXGI_FORMAT _chooseD3DFormat()
internal method, return a D3D pixel format for texture creation
SharedPtr< vector< MemoryDataStreamPtr >::type > LoadedStreams
This class represents a RenderTarget that renders to a Texture.
void _setSrcAttributes(unsigned long width, unsigned long height, unsigned long depth, PixelFormat format)
internal method, set Texture class source image protected attributes
vector< HardwarePixelBufferSharedPtr >::type SurfaceList
Vector of pointers to subsurfaces.
HardwarePixelBufferSharedPtr getBuffer(size_t face, size_t mipmap)
Return hardware pixel buffer for a surface.
Shared pointer implementation used to share pixel buffers.
ID3D11Texture1D * GetTex1D()
void prepareImpl(void)
Internal implementation of the meat of the 'prepare' action.
bool mAutoMipMapGeneration
D3D11_SHADER_RESOURCE_VIEW_DESC mSRVDesc
ID3D11Resource * mpTex
actual texture pointer
virtual void getCustomAttribute(const String &name, void *pData)
Retrieve a platform or API-specific piece of information from this texture.
Defines a generic resource handler.
Class representing an image file.
ID3D11Texture3D * GetTex3D()
void unprepareImpl(void)
Internal function for undoing the 'prepare' action.
#define OGRE_EXCEPT(num, desc, src)
ID3D11DepthStencilView * mDepthStencilView
bool recreateIfDefaultPool(D3D11Device &device)
For dealing with lost devices - recreate the resource if in the default pool (and return true) ...
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...
void _create3DTex()
internal method, create a blank cube texture
D3D11_SHADER_RESOURCE_VIEW_DESC getShaderResourceViewDesc() const
const String getErrorDescription(const HRESULT hr=NO_ERROR) const
Reference-counted shared pointer, used for objects where implicit destruction is required.
void createInternalResourcesImpl(void)
Implementation of creating internal texture resources.
void postLoadImpl()
overridden from Resource
LoadedStreams mLoadedStreams
Vector of pointers to streams that were pulled from disk by prepareImpl but have yet to be pushed int...
void _loadDDS(DataStreamPtr &dstream)
void freeInternalResourcesImpl(void)
free internal resources
D3D11Device & mDevice
D3DDevice pointer.
void _create3DResourceView()
void freeInternalResources(void)
Frees internal texture resources for this texture.
ID3D11Texture1D * mp1DTex
D3D11 pointer.