コード例 #1
0
ファイル: RenderTexture.cpp プロジェクト: Jebbs/DSFML
void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture,
                                    const void* vertices, DUint vertexCount,
                                    DInt type, DInt colorSrcFactor, DInt colorDstFactor,
									DInt colorEquation, DInt alphaSrcFactor, DInt alphaDstFactor,
									DInt alphaEquation, const float* transform, const sfTexture*
									texture, const sfShader* shader)
{
    renderTexture->This.draw(reinterpret_cast<const sf::Vertex*>(vertices), vertexCount, static_cast<sf::PrimitiveType>(type), createRenderStates(colorSrcFactor,
    		colorDstFactor, colorEquation, alphaSrcFactor, alphaDstFactor, alphaEquation, transform, texture, shader));
}
コード例 #2
0
// Init
HRESULT CFW1GlyphRenderStates::initRenderResources(
	IFW1Factory *pFW1Factory,
	ID3D11Device *pDevice,
	bool wantGeometryShader,
	bool anisotropicFiltering
) {
	HRESULT hResult = initBaseObject(pFW1Factory);
	if(FAILED(hResult))
		return hResult;
	
	if(pDevice == NULL)
		return E_INVALIDARG;
	
	pDevice->AddRef();
	m_pDevice = pDevice;
	m_featureLevel = m_pDevice->GetFeatureLevel();
	
	// D3DCompiler
#ifdef FW1_DELAYLOAD_D3DCOMPILER_XX_DLL
	HMODULE hD3DCompiler = LoadLibrary(D3DCOMPILER_DLL);
	if(hD3DCompiler == NULL) {
		DWORD dwErr = GetLastError();
		dwErr;
		m_lastError = std::wstring(L"Failed to load ") + D3DCOMPILER_DLL_W;
		hResult = E_FAIL;
	}
	else {
		m_pfnD3DCompile = reinterpret_cast<pD3DCompile>(GetProcAddress(hD3DCompiler, "D3DCompile"));
		if(m_pfnD3DCompile == NULL) {
			DWORD dwErr = GetLastError();
			dwErr;
			m_lastError = std::wstring(L"Failed to load D3DCompile from ") + D3DCOMPILER_DLL_W;
			hResult = E_FAIL;
		}
		else {
			hResult = S_OK;
		}
	}
#else
	m_pfnD3DCompile = D3DCompile;
	hResult = S_OK;
#endif
	
	// Create all needed resources
	if(SUCCEEDED(hResult))
		hResult = createQuadShaders();
	if(SUCCEEDED(hResult))
		hResult = createPixelShaders();
	if(SUCCEEDED(hResult))
		hResult = createConstantBuffer();
	if(SUCCEEDED(hResult))
		hResult = createRenderStates(anisotropicFiltering);
	if(SUCCEEDED(hResult) && wantGeometryShader) {
		hResult = createGlyphShaders();
		if(FAILED(hResult))
			hResult = S_OK;
	}
	
	if(SUCCEEDED(hResult))
		hResult = S_OK;
	
#ifdef FW1_DELAYLOAD_D3DCOMPILER_XX_DLL
	FreeLibrary(hD3DCompiler);
#endif
	
	return hResult;
}
コード例 #3
0
ファイル: RenderWindow.cpp プロジェクト: luke5542/DSFMLC
void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
                                   const void* vertices, DUint vertexCount, DInt type, DInt blendMode,const float* transform, const sfTexture* texture, const sfShader* shader)
{
    renderWindow->This.draw(static_cast<const sf::Vertex*>(vertices), vertexCount, static_cast<sf::PrimitiveType>(type), createRenderStates(blendMode, transform, texture, shader));
}