当前位置: 首页>>代码示例>>C++>>正文


C++ IDirect3DDevice9::CreateTexture方法代码示例

本文整理汇总了C++中IDirect3DDevice9::CreateTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirect3DDevice9::CreateTexture方法的具体用法?C++ IDirect3DDevice9::CreateTexture怎么用?C++ IDirect3DDevice9::CreateTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDirect3DDevice9的用法示例。


在下文中一共展示了IDirect3DDevice9::CreateTexture方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Texture

TextureDX9::TextureDX9(
	const PixelFormat texFormat, const TexType texType,
	const unsigned int sizeX, const unsigned int sizeY, const unsigned int sizeZ,
	const unsigned int mipmapLevelCount, const BufferUsage usage)
	: Texture(texFormat, texType, sizeX, sizeY, sizeZ, mipmapLevelCount, usage)
	, m_pTexture(nullptr)
	, m_pTempBuffer(nullptr)
	, m_nRowPitch(0)
	, m_nDepthPitch(0)
{
	IDirect3DDevice9* device = RendererDX9::GetInstance()->GetDevice();

	D3DPOOL pool;
	if (GetUsage() == BU_TEXTURE)
		pool = D3DPOOL_MANAGED;
	else
		pool = D3DPOOL_DEFAULT;

	HRESULT hr;
	DWORD usageFlags;
	switch (GetTextureType())
	{
	case TT_1D:
		hr = device->CreateTexture(
				GetWidth(), 1u, GetMipmapLevelCount(),
				BufferUsageDX9[m_eBufferUsage], TextureFormatDX9[m_eTexFormat],
				pool, (IDirect3DTexture9**)&m_pTexture, 0);
		break;

	case TT_2D:
		usageFlags = BufferUsageDX9[m_eBufferUsage];
		if (m_eBufferUsage == BU_RENDERTAGET && mipmapLevelCount == 0)
		{
			// automatic mipmap generation for RTs
			usageFlags |= D3DUSAGE_AUTOGENMIPMAP;
			m_bAutogenMipmaps = true;
		}
		hr = device->CreateTexture(
				GetWidth(), GetHeight(), m_bAutogenMipmaps ? 0 : GetMipmapLevelCount(),
				usageFlags, TextureFormatDX9[m_eTexFormat],
				pool, (IDirect3DTexture9**)&m_pTexture, 0);
		break;

	case TT_3D:
		hr = device->CreateVolumeTexture(
				GetWidth(), GetHeight(), GetDepth(), GetMipmapLevelCount(),
				BufferUsageDX9[m_eBufferUsage], TextureFormatDX9[m_eTexFormat],
				pool, (IDirect3DVolumeTexture9**)&m_pTexture, 0);
		break;

	case TT_CUBE:
		hr = device->CreateCubeTexture(
				GetWidth(), GetMipmapLevelCount(),
				BufferUsageDX9[m_eBufferUsage], TextureFormatDX9[m_eTexFormat],
				pool, (IDirect3DCubeTexture9**)&m_pTexture, 0);
	}
	assert(SUCCEEDED(hr));
}
开发者ID:iftodebogdan,项目名称:ShaderEditor,代码行数:58,代码来源:TextureDX9.cpp

示例2: CryLogAlways

    Coherent::UI::CoherentHandle CCoherentUISystem::CreateSharedTextureDX9( const CreateSurfaceTask& task, TexturePair* outTexturePair )
    {
        IDirect3DTexture9* pD3DTex = nullptr;
        // Create a shared texture
        HANDLE result = 0;
        IDirect3DDevice9* pDevice = static_cast<IDirect3DDevice9*>( gD3DDevice );
        HRESULT hr = pDevice->CreateTexture( task.Width, task.Height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &pD3DTex, &result );

        if ( FAILED( hr ) )
        {
            CryLogAlways( "Unable to create shared texture with DirectX9 renderer!" );
        }

        ITexture* pCryTex = gD3DSystem->InjectTexture( pD3DTex, task.Width, task.Height, eTF_A8R8G8B8, 0 );
        // The native texture has one more reference after InjectTexture

        if ( outTexturePair )
        {
            outTexturePair->CryTextureID = pCryTex->GetTextureID();
            outTexturePair->NativeTexture.pTexDX9 = pD3DTex;
        }

        SAFE_RELEASE( pD3DTex );

        return Coherent::UI::CoherentHandle( result );
    }
开发者ID:iherwig,项目名称:Plugin_CoherentUI,代码行数:26,代码来源:CoherentUISystem.cpp

示例3: if

	void D3D9Texture::createHardwareResource()
	{
		IDirect3DDevice9* dev = mFatherManager->getAs<D3D9TextureManager>()
			->getD3DResourceFactory()->getMainDevice();

		// release created resources.
		releaseHardwareResource();
		D3DFORMAT texFormat = (mFormat == PF_Unknown) ? D3DFMT_A8R8G8B8 : D3D9Translator::getD3DFormat(mFormat);
		uint32 mipmap = mMipMapCount == MIPMAP_MAXCOUNT ? 0 : mMipMapCount + 1;
		if (mType == TT_1D || mType == TT_2D)
		{
			dev->CreateTexture(mWidth, mHeight, mipmap, 0,
				texFormat, D3DPOOL_MANAGED, &mTexture.p2DTexture, NULL);
			mTexture.pBaseTexture = mTexture.p2DTexture;
		}
		else if (mType == TT_3D)
		{
			dev->CreateVolumeTexture(mWidth, mHeight, mDepth, mipmap, 0, 
				texFormat, D3DPOOL_MANAGED, &mTexture.p3DTexture, NULL);
			mTexture.pBaseTexture = mTexture.p3DTexture;
		}
		else
		{
			dev-> CreateCubeTexture(mWidth, mipmap, 0,
				texFormat, D3DPOOL_MANAGED, &mTexture.pCubeTexture, NULL);
			mTexture.pBaseTexture = mTexture.pCubeTexture;
		}

		createSurfaceList();
		mTextureConstant = DGpuTextureConstantPtr(new D3D9GpuTextureConstant(mTexture.pBaseTexture));
	}
开发者ID:jiazhipeng03,项目名称:Duel-Engine,代码行数:31,代码来源:DuelD3D9Texture.cpp

示例4: GetTextureUsage

TextureStorage9_2D::TextureStorage9_2D(Renderer *renderer, GLenum internalformat, bool renderTarget, GLsizei width, GLsizei height, int levels)
    : TextureStorage9(renderer, GetTextureUsage(internalformat, Renderer9::makeRenderer9(renderer), renderTarget))
{
    mTexture = NULL;
    mRenderTarget = NULL;
    // if the width or height is not positive this should be treated as an incomplete texture
    // we handle that here by skipping the d3d texture creation
    if (width > 0 && height > 0)
    {
        IDirect3DDevice9 *device = mRenderer->getDevice();
        D3DFORMAT format = gl_d3d9::GetTextureFormat(internalformat, mRenderer);
        d3d9::MakeValidSize(false, format, &width, &height, &mTopLevel);
        UINT creationLevels = (levels == 0) ? 0 : mTopLevel + levels;

        HRESULT result = device->CreateTexture(width, height, creationLevels, getUsage(), format, getPool(), &mTexture, NULL);

        if (FAILED(result))
        {
            ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
            gl::error(GL_OUT_OF_MEMORY);
        }
    }

    initializeRenderTarget();
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:25,代码来源:TextureStorage9.cpp

示例5:

//----------------------------------------------------------------------------
PdrTexture2D::PdrTexture2D (Renderer* renderer, bool isColorTexture,
							const Texture2D* texture, bool autoGenMipMap)
{
	IDirect3DDevice9* device = renderer->mData->mDevice;
	HRESULT hr;
	PX2_UNUSED(hr);

	if (isColorTexture)
	{
		UINT levels = 1;
		DWORD usage = gDX9BufferUsage[texture->GetUsage()];
		if (autoGenMipMap)
		{
			levels = 0;
			usage |= D3DUSAGE_AUTOGENMIPMAP;
		}

		hr = device->CreateTexture((UINT)texture->GetWidth(),
			(UINT)texture->GetHeight(), levels, usage,
			gDX9TextureFormat[texture->GetFormat()], D3DPOOL_DEFAULT,
			&mTexture, 0);
		assertion(hr == D3D_OK,
			"Failed to create render target color texture: %s\n",
			DXGetErrorString(hr));
	}
	else
	{
		hr = device->CreateTexture((UINT)texture->GetWidth(),
			(UINT)texture->GetHeight(), 1,
			gDX9BufferUsage[texture->GetUsage()],
			gDX9TextureFormat[texture->GetFormat()],
			D3DPOOL_DEFAULT, &mTexture, 0);
		assertion(hr == D3D_OK,
			"Failed to create render target depthstencil texture: %s\n",
			DXGetErrorString(hr));
	}
}
开发者ID:manyxu,项目名称:Phoenix3D_2.0,代码行数:38,代码来源:PX2Dx9Texture2D.cpp

示例6: error

IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const RECT &sourceRect)
{
    egl::Display *display = getDisplay();
    IDirect3DDevice9 *device = getDevice();

    D3DSURFACE_DESC sourceDesc;
    surface->GetDesc(&sourceDesc);

    // Copy the render target into a texture
    IDirect3DTexture9 *texture;
    HRESULT result = device->CreateTexture(sourceRect.right - sourceRect.left, sourceRect.bottom - sourceRect.top, 1, D3DUSAGE_RENDERTARGET, sourceDesc.Format, D3DPOOL_DEFAULT, &texture, NULL);

    if (FAILED(result))
    {
        ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
        return error(GL_OUT_OF_MEMORY, (IDirect3DTexture9*)NULL);
    }

    IDirect3DSurface9 *textureSurface;
    result = texture->GetSurfaceLevel(0, &textureSurface);

    if (FAILED(result))
    {
        ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
        texture->Release();
        return error(GL_OUT_OF_MEMORY, (IDirect3DTexture9*)NULL);
    }

    RECT d3dSourceRect;
    d3dSourceRect.left = sourceRect.left;
    d3dSourceRect.right = sourceRect.right;
    d3dSourceRect.top = sourceRect.top;
    d3dSourceRect.bottom = sourceRect.bottom;

    display->endScene();
    result = device->StretchRect(surface, &d3dSourceRect, textureSurface, NULL, D3DTEXF_NONE);

    textureSurface->Release();

    if (FAILED(result))
    {
        ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
        texture->Release();
        return error(GL_OUT_OF_MEMORY, (IDirect3DTexture9*)NULL);
    }

    return texture;
}
开发者ID:pelegri,项目名称:WebKit-PlayBook,代码行数:48,代码来源:Blit.cpp

示例7: newTexture

void DevState::newTexture(unsigned int width, unsigned int height) {
	ods("D3D9: New texture %d x %d", width, height);

	if (texTexture) {
		texTexture->Release();
		texTexture = NULL;
	}

	dev->CreateTexture(uiWidth, uiHeight, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texTexture, NULL);

	for (int i = 0; i < 4; ++i) {
		vertices[i].x = vertices[i].y = vertices[i].z = 0.0f;
		vertices[i].tu = vertices[i].tv = 0.0f;
		vertices[i].rhw = 1.0f;
	}
}
开发者ID:Andrew-McLeod,项目名称:mumble,代码行数:16,代码来源:d3d9.cpp

示例8:

/// @copydoc D3D9DeviceResetListener::OnPostReset()
void D3D9DynamicTexture2d::OnPostReset( D3D9Renderer* pRenderer )
{
    HELIUM_ASSERT( pRenderer );
    IDirect3DDevice9* pDevice = pRenderer->GetD3DDevice();
    HELIUM_ASSERT( pDevice );

    // Recreate the texture.
    static const DWORD d3dUsages[] =
    {
        0,                      // RENDERER_BUFFER_USAGE_STATIC
        D3DUSAGE_DYNAMIC,       // RENDERER_BUFFER_USAGE_DYNAMIC
        D3DUSAGE_RENDERTARGET,  // RENDERER_BUFFER_USAGE_RENDER_TARGET
        D3DUSAGE_DEPTHSTENCIL   // RENDERER_BUFFER_USAGE_DEPTH_STENCIL
    };

    HELIUM_ASSERT( !m_pTexture );
    HELIUM_D3D9_VERIFY( pDevice->CreateTexture(
        m_width,
        m_height,
        m_mipLevelCountMinusOne + 1,
        d3dUsages[ m_usage ],
        m_format,
        D3DPOOL_DEFAULT,
        &m_pTexture,
        NULL ) );

    // Reassign surface references to any D3D9Surface objects cached during OnPreReset().
    uint_fast32_t mipLevelCount = m_mipLevelCountMinusOne + 1;
    for( uint_fast32_t levelIndex = 0; levelIndex < mipLevelCount; ++levelIndex )
    {
        D3D9Surface* pSurface = m_surfaces[ levelIndex ];
        if( pSurface )
        {
            IDirect3DSurface9* pD3DSurface = NULL;
            HELIUM_D3D9_VERIFY( m_pTexture->GetSurfaceLevel( static_cast< UINT >( levelIndex ), &pD3DSurface ) );
            HELIUM_ASSERT( pD3DSurface );

            pSurface->SetD3DSurface( pD3DSurface );

            m_surfaces[ levelIndex ].Release();

            pD3DSurface->Release();
        }
    }
}
开发者ID:Fantasticer,项目名称:Helium,代码行数:46,代码来源:D3D9DynamicTexture2d.cpp

示例9: Error

gl::Error Blit9::copySurfaceToTexture(IDirect3DSurface9 *surface, const RECT &sourceRect, IDirect3DTexture9 **outTexture)
{
    ASSERT(surface);

    IDirect3DDevice9 *device = mRenderer->getDevice();

    D3DSURFACE_DESC sourceDesc;
    surface->GetDesc(&sourceDesc);

    // Copy the render target into a texture
    IDirect3DTexture9 *texture;
    HRESULT result = device->CreateTexture(sourceRect.right - sourceRect.left, sourceRect.bottom - sourceRect.top, 1, D3DUSAGE_RENDERTARGET, sourceDesc.Format, D3DPOOL_DEFAULT, &texture, NULL);

    if (FAILED(result))
    {
        ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
        return gl::Error(GL_OUT_OF_MEMORY, "Failed to allocate internal texture for blit, result: 0x%X.", result);
    }

    IDirect3DSurface9 *textureSurface;
    result = texture->GetSurfaceLevel(0, &textureSurface);

    if (FAILED(result))
    {
        ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
        SafeRelease(texture);
        return gl::Error(GL_OUT_OF_MEMORY, "Failed to query surface of internal blit texture, result: 0x%X.", result);
    }

    mRenderer->endScene();
    result = device->StretchRect(surface, &sourceRect, textureSurface, NULL, D3DTEXF_NONE);

    SafeRelease(textureSurface);

    if (FAILED(result))
    {
        ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
        SafeRelease(texture);
        return gl::Error(GL_OUT_OF_MEMORY, "Failed to copy between internal blit textures, result: 0x%X.", result);
    }

    *outTexture = texture;
    return gl::Error(GL_NO_ERROR);
}
开发者ID:AlexSoehn,项目名称:qt-base-deb,代码行数:44,代码来源:Blit9.cpp

示例10: assertion

//----------------------------------------------------------------------------
PdrTexture1D::PdrTexture1D (Renderer* renderer, const Texture1D* texture)
{
    IDirect3DDevice9* device = renderer->mData->mDevice;

    int numLevels = texture->GetNumLevels();
    HRESULT hr = device->CreateTexture((UINT)texture->GetLength(), 1u,
        (UINT)numLevels, gDX9BufferUsage[texture->GetUsage()],
        gDX9TextureFormat[texture->GetFormat()], D3DPOOL_MANAGED,
        &mTexture, 0);
    WM5_UNUSED(hr);
    assertion(hr == D3D_OK, "Failed to create 1D texture: %s\n",
        DXGetErrorString(hr));

    for (int level = 0; level < numLevels; ++level)
    {
        void* data = Lock(level, Buffer::BL_WRITE_ONLY);
        memcpy(data, texture->GetData(level),
            texture->GetNumLevelBytes(level));
        Unlock(level);
    }
}
开发者ID:rasslingcats,项目名称:calico,代码行数:22,代码来源:Wm5Dx9Texture1D.cpp

示例11: locker

IDirect3DTexture9* MythRenderD3D9::CreateTexture(const QSize &size)
{
    D3D9Locker locker(this);
    IDirect3DDevice9* dev = locker.Acquire();
    if (!dev)
        return NULL;

    IDirect3DTexture9* temp_texture = NULL;

    HRESULT hr = dev->CreateTexture(
                    size.width(),  size.height(), 1, D3DUSAGE_RENDERTARGET,
                    m_texture_fmt, D3DPOOL_DEFAULT, &temp_texture, NULL);

    if (FAILED(hr) || !temp_texture)
    {
        VERBOSE(VB_IMPORTANT, D3DERR + "Failed to create texture.");
        return NULL;
    }

    m_textures[temp_texture] = size;;
    return temp_texture;
}
开发者ID:DocOnDev,项目名称:mythtv,代码行数:22,代码来源:mythrender_d3d9.cpp

示例12: Error

gl::Error TextureStorage9_2D::getBaseTexture(IDirect3DBaseTexture9 **outTexture)
{
    // if the width or height is not positive this should be treated as an incomplete texture
    // we handle that here by skipping the d3d texture creation
    if (mTexture == NULL && mTextureWidth > 0 && mTextureHeight > 0)
    {
        ASSERT(mMipLevels > 0);

        IDirect3DDevice9 *device = mRenderer->getDevice();
        HRESULT result = device->CreateTexture(mTextureWidth, mTextureHeight, mMipLevels, getUsage(), mTextureFormat,
                                               getPool(), &mTexture, NULL);

        if (FAILED(result))
        {
            ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
            return gl::Error(GL_OUT_OF_MEMORY, "Failed to create 2D storage texture, result: 0x%X.", result);
        }
    }

    *outTexture = mTexture;
    return gl::Error(GL_NO_ERROR);
}
开发者ID:contoso-d,项目名称:angle,代码行数:22,代码来源:TextureStorage9.cpp

示例13: ASSERT

void DX9Texture::createFallbackTexture(HDResourceMgr *pMgr)
{
    ASSERT(pMgr);

    DX9ResourceMgr* pDX9Mgr = (DX9ResourceMgr*)pMgr;
    IDirect3DDevice9* pDev = pDX9Mgr->getDX9Device();
    HRESULT hr;

    const int SIZE = 128;

    hr = pDev->CreateTexture(SIZE, SIZE, 1, 0,
                             D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &s_fallbackTexture, NULL);
    if(FAILED(hr))
    {
        LOG("fallback texture create failed");
        return;
    }

    D3DLOCKED_RECT lockRect;
    hr = s_fallbackTexture->LockRect(0, &lockRect, NULL, 0);
    if(SUCCEEDED(hr))
    {
        D3DCOLOR fallColor[2];
        fallColor[0] = D3DCOLOR_ARGB(255,5,250,250);
        fallColor[1] = D3DCOLOR_ARGB(255,5,0,5);

        D3DCOLOR *pPixel = (D3DCOLOR *)lockRect.pBits;
        for(int y=0; y<SIZE; y++)
        {
            for(int x=0; x<SIZE; x++)
            {
                int sel = (x/16)%2+(y/16+1)%2;
                pPixel[y*SIZE+x] = fallColor[sel%2];
            }
        }
        hr = s_fallbackTexture->UnlockRect(0);
    }//endof if
}
开发者ID:WangShuwei6,项目名称:MagicGearEditor3D,代码行数:38,代码来源:DX9Resource.cpp

示例14: GetTextureUsage

TextureStorage9_2D::TextureStorage9_2D(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, GLsizei width, GLsizei height)
    : TextureStorage9(renderer, GetTextureUsage(Renderer9::makeRenderer9(renderer)->ConvertTextureInternalFormat(internalformat), usage, forceRenderable))
{
    mTexture = NULL;
    mRenderTarget = NULL;
    // if the width or height is not positive this should be treated as an incomplete texture
    // we handle that here by skipping the d3d texture creation
    if (width > 0 && height > 0)
    {
        IDirect3DDevice9 *device = mRenderer->getDevice();
        gl::MakeValidSize(false, gl::IsCompressed(internalformat), &width, &height, &mLodOffset);
        HRESULT result = device->CreateTexture(width, height, levels ? levels + mLodOffset : 0, getUsage(),
                                               mRenderer->ConvertTextureInternalFormat(internalformat), getPool(), &mTexture, NULL);

        if (FAILED(result))
        {
            ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
            gl::error(GL_OUT_OF_MEMORY);
        }
    }

    initializeRenderTarget();
}
开发者ID:13609594236,项目名称:CrossApp,代码行数:23,代码来源:TextureStorage9.cpp

示例15: LXTextureCreateWithData

LXTextureRef LXTextureCreateWithData(uint32_t w, uint32_t h, LXPixelFormat pxFormat, uint8_t *buffer, size_t rowBytes,
                                                    LXUInteger storageHint,
                                                    LXError *outError)
{
    const LXBool useClientStorage = (storageHint & kLXStorageHint_ClientStorage) ? YES : NO;
    const LXBool useAGPTexturing =  (storageHint & kLXStorageHint_PreferDMAToCaching) ? YES : NO;

	if ( !buffer || rowBytes < 1)
		return NULL;

	HRESULT hRes;
    D3DFORMAT texFormat = LXD3DFormatFromLXPixelFormat(pxFormat);
    
	if (texFormat == 0) {
		LXPrintf("** %s -- invalid texture format (%i)\n", __func__, pxFormat);
        LXErrorSet(outError, 4802, "invalid texture format");
		return NULL;
	}

	IDirect3DDevice9 *dxDev = LXPlatformGetSharedD3D9Device();
	if ( !dxDev) {
		LXPrintf("** %s -- no d3d device set, can't create texture\n", __func__);
        LXErrorSet(outError, 4803, "no d3d device");
		return NULL;
	}

    IDirect3DTexture9 *newTexture = NULL;

	hRes = dxDev->CreateTexture(w, h, 1,
                                ((useClientStorage || useAGPTexturing) ? D3DUSAGE_DYNAMIC : D3DUSAGE_WRITEONLY),
								texFormat,
                                (useClientStorage || useAGPTexturing) ? D3DPOOL_DEFAULT : D3DPOOL_MANAGED,
                                &newTexture, NULL);
                                
	const char *errStr = NULL;
	switch (hRes) {
		case D3D_OK:  break;
		case D3DERR_INVALIDCALL: errStr = "Invalid call"; break;
		case D3DERR_OUTOFVIDEOMEMORY: errStr = "Out of video memory"; break;
		case E_OUTOFMEMORY: errStr = "Out of system memory"; break;
		default: errStr = "unknown"; break;
	}
	if (errStr) {
		LXPrintf("** %s -- D3D error '%s' (%i * %i, pf %lu, cs %i, agp %i)\n", __func__, errStr, w, h, pxFormat, useClientStorage, useAGPTexturing);
            LXErrorSet(outError, 4810, "D3D error");
		return NULL;
	}

    writeTextureData(newTexture, w, h, pxFormat, buffer, rowBytes);

    LXTextureRef newRef = LXTextureCreateWithD3DTextureAndLXSurface_(newTexture, w, h, pxFormat, NULL);
    
    if (newRef) {
        LXTextureDXImpl *imp = (LXTextureDXImpl *)newRef;
        imp->storageHint = storageHint;
    
        // it's safe to store the data pointer only if client storage was specified
        if (useClientStorage) {
            imp->buffer = buffer;
            imp->rowBytes = rowBytes;
        }
    }
    
    newTexture->Release();
    return newRef;
}
开发者ID:pojala,项目名称:lacefx,代码行数:66,代码来源:LXTexture_d3d.cpp


注:本文中的IDirect3DDevice9::CreateTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。