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


C++ D3DVS_VERSION函数代码示例

本文整理汇总了C++中D3DVS_VERSION函数的典型用法代码示例。如果您正苦于以下问题:C++ D3DVS_VERSION函数的具体用法?C++ D3DVS_VERSION怎么用?C++ D3DVS_VERSION使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: IDirect3D8Impl_GetDeviceCaps

static HRESULT  WINAPI  IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps) {
    IDirect3D8Impl *This = (IDirect3D8Impl *)iface;
    HRESULT hrc = D3D_OK;
    WINED3DCAPS *pWineCaps;

    TRACE("(%p) Relay %d %u %p\n", This, Adapter, DeviceType, pCaps);

    if(NULL == pCaps){
        return D3DERR_INVALIDCALL;
    }
    pWineCaps = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINED3DCAPS));
    if(pWineCaps == NULL){
        return D3DERR_INVALIDCALL; /*well this is what MSDN says to return*/
    }
    EnterCriticalSection(&d3d8_cs);
    hrc = IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, pWineCaps);
    LeaveCriticalSection(&d3d8_cs);
    WINECAPSTOD3D8CAPS(pCaps, pWineCaps)
    HeapFree(GetProcessHeap(), 0, pWineCaps);

    /* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */
    if(pCaps->PixelShaderVersion > D3DPS_VERSION(1,4)){
        pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
    }
    if(pCaps->VertexShaderVersion > D3DVS_VERSION(1,1)){
        pCaps->VertexShaderVersion = D3DVS_VERSION(1,1);
    }

    TRACE("(%p) returning %p\n", This, pCaps);
    return hrc;
}
开发者ID:devyn,项目名称:wine,代码行数:31,代码来源:directx.c

示例2: fixup_caps

void fixup_caps(WINED3DCAPS *caps)
{
    /* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */
    if (caps->PixelShaderVersion > D3DPS_VERSION(1,4)) {
        caps->PixelShaderVersion = D3DPS_VERSION(1,4);
    }
    if (caps->VertexShaderVersion > D3DVS_VERSION(1,1)) {
        caps->VertexShaderVersion = D3DVS_VERSION(1,1);
    }
    caps->MaxVertexShaderConst = min(D3D8_MAX_VERTEX_SHADER_CONSTANTF, caps->MaxVertexShaderConst);

    caps->StencilCaps &= ~WINED3DSTENCILCAPS_TWOSIDED;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:13,代码来源:directx.c

示例3: test_get_shader_version

static void test_get_shader_version(void)
{
    DWORD shader_version;

    shader_version = D3DXGetShaderVersion(simple_vs);
    ok(shader_version == D3DVS_VERSION(1, 1), "Got shader version 0x%08x, expected 0x%08x\n",
            shader_version, D3DVS_VERSION(1, 1));

    shader_version = D3DXGetShaderVersion(simple_ps);
    ok(shader_version == D3DPS_VERSION(1, 1), "Got shader version 0x%08x, expected 0x%08x\n",
            shader_version, D3DPS_VERSION(1, 1));

    shader_version = D3DXGetShaderVersion(NULL);
    ok(shader_version == 0, "Got shader version 0x%08x, expected 0\n", shader_version);
}
开发者ID:YokoZar,项目名称:wine,代码行数:15,代码来源:shader.c

示例4:

void CD3DSkelMesh::Reset()
{
	m_VBController.Reset();
	m_iMaxBonesPerVert	= 0;
	m_iMaxBonesPerTri	= 0;
	m_iVertCount		= 0;
	m_iPolyCount		= 0;
	m_eRenderMethod		= eD3DRenderDirect;
	m_iBoneSetCount		= 0;
	m_pBoneSetArray		= NULL;
	m_VertType			= eNO_WORLD_BLENDS;
	m_bSWVertProcessing	= ((g_Device.GetDeviceCaps()->DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0) ? true : false;


	m_bSWVSBuffers = false;

	// Use software processing for shaders ? 
	if ( g_Device.GetDeviceCaps()->VertexShaderVersion < D3DVS_VERSION(1,1) )
		m_bSWVSBuffers = true;

	// in case software has been forced 
	if ( g_CV_ForceSWVertProcess )
		m_bSWVertProcessing = true;

	m_pIndexData		= NULL;
	m_bNonFixPipeData	= false;
	m_bReIndexedBones	= false;
	m_pReIndexedBoneList= NULL;

	for (uint32 i = 0; i < 4; ++i)
		m_pVertData[i] = NULL;
}
开发者ID:emoose,项目名称:lithtech,代码行数:32,代码来源:d3dmeshrendobj_skel.cpp

示例5:

void D3D9VideoInfo::SetupShaderProfile()
{
	if (m_caps.VertexShaderVersion >= D3DVS_VERSION(1,1))
		m_lastVertexProfile = Shader::SP_MODEL_1;
	if (m_caps.VertexShaderVersion >= D3DVS_VERSION(2,0))
		m_lastVertexProfile = Shader::SP_MODEL_2;
	if (m_caps.VertexShaderVersion >= D3DVS_VERSION(3,0))
		m_lastVertexProfile = Shader::SP_MODEL_3;

	if (m_caps.PixelShaderVersion >= D3DPS_VERSION(1,0))
		m_lastPixelProfile = Shader::SP_MODEL_1;
	if (m_caps.PixelShaderVersion >= D3DPS_VERSION(2,0))
		m_lastPixelProfile = Shader::SP_MODEL_2;
	if (m_caps.PixelShaderVersion >= D3DPS_VERSION(3,0))
		m_lastPixelProfile = Shader::SP_MODEL_3;
}
开发者ID:angeltown,项目名称:ethanon,代码行数:16,代码来源:D3D9VideoInfo.cpp

示例6: UNREFERENCED_PARAMETER

//-------------------------------------------------------------
// Name: ConfirmDevice()
// Desc: �ʱ�ȭ�� ȣ���. �ʿ��� �ɷ�(caps)üũ
//-------------------------------------------------------------
HRESULT CMyD3DApplication::ConfirmDevice( D3DCAPS9* pCaps,
                     DWORD dwBehavior,    D3DFORMAT Format )
{
    UNREFERENCED_PARAMETER( Format );
    
    BOOL bCapsAcceptable;

    // �׷��Ⱥ��尡 ���α׷��� ������ �ɷ��� �ִ°� Ȯ��
    bCapsAcceptable = TRUE;

	// �� �ȼ����̴� ����Ȯ��
	if( pCaps->PixelShaderVersion < D3DPS_VERSION(1,1) )
	        bCapsAcceptable = FALSE;

    // �������̴� ����Ȯ��
    if( (dwBehavior & D3DCREATE_HARDWARE_VERTEXPROCESSING ) ||
        (dwBehavior & D3DCREATE_MIXED_VERTEXPROCESSING ) )
    {
        if( pCaps->VertexShaderVersion < D3DVS_VERSION(1,1) )
            bCapsAcceptable = FALSE;
    }

    if( bCapsAcceptable )         
        return S_OK;
    else
        return E_FAIL;
}
开发者ID:jjuiddong,项目名称:Dx9-Shader,代码行数:31,代码来源:main.cpp

示例7:

void CD3DVAMesh::Reset()
{
	m_VBController.Reset();
	m_iMaxBonesPerVert	= 0;
	m_iMaxBonesPerTri	= 0;
	m_iVertCount		= 0;
	m_iUnDupVertCount	= 0;
	m_iPolyCount		= 0;
	m_iBoneEffector		= 0;
	m_iAnimNodeIdx		= 0;
	m_iDupMapListCount	= 0;
	m_pDupMapList		= NULL;
	m_pIndexData		= NULL;
	m_bSWVertProcessing	= ((g_Device.GetDeviceCaps()->DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0) ? true : false;


	m_bSWVSBuffers = false;

	// Use software processing for shaders ? 
	if ( g_Device.GetDeviceCaps()->VertexShaderVersion < D3DVS_VERSION(1,1) )
		m_bSWVSBuffers = true;


	// in case software has been forced 
	if ( g_CV_ForceSWVertProcess )
		m_bSWVertProcessing = true;


	m_bNonFixPipeData	= false;

	for (uint32 i = 0; i < 4; ++i) m_pVertData[i] = NULL;
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:32,代码来源:d3dmeshrendobj_vertanim.cpp

示例8: Load

HRESULT BUMPMAP::Load()
{
   D3DCAPS9 caps;

   m_spD3DDevice->GetDeviceCaps( &caps );
   if( caps.VertexShaderVersion >= D3DVS_VERSION( 1, 1 ) && caps.PixelShaderVersion >= D3DPS_VERSION( 2, 0 ) )
   {
      LPD3DXBUFFER pErr = NULL;
      HRESULT hr = D3DXCreateEffectFromFile( m_spD3DDevice, "BumpMap.fx", NULL, NULL, 0, NULL, &m_pEffect, &pErr );
      if( SUCCEEDED( hr ) )
      {
         m_pTechnique     = m_pEffect->GetTechniqueByName( "TShader" );
         m_pWVP           = m_pEffect->GetParameterByName( NULL, "m_WVP" );
         m_pLightDir      = m_pEffect->GetParameterByName( NULL, "m_LightDir" );
         m_pEyePos        = m_pEffect->GetParameterByName( NULL, "m_EyePos" );
         m_pAmbient       = m_pEffect->GetParameterByName( NULL, "m_Ambient" );
         m_pSpecularPower = m_pEffect->GetParameterByName( NULL, "m_SpecularPower" );
         m_pSpecular      = m_pEffect->GetParameterByName( NULL, "m_Specular" );

         m_pEffect->SetTechnique( m_pTechnique );   
      }

      else
      {
         return -1;
      }
   }

   else
   {
      return -2;
   }

   return S_OK;
}
开发者ID:kojima04,项目名称:Kojima_lib,代码行数:35,代码来源:BumpMap2.cpp

示例9: InitD3D

LRESULT InitD3D(HWND hWnd)
{
	if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
		return E_FAIL;
	D3DDISPLAYMODE d3ddm;
	if( FAILED( g_pD3D->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &d3ddm ) ) )
		return E_FAIL;
	D3DPRESENT_PARAMETERS d3dpp; 
	ZeroMemory( &d3dpp, sizeof(d3dpp) );
	d3dpp.Windowed   = TRUE;

	d3dpp.BackBufferCount        = 2;
	d3dpp.MultiSampleType        = D3DMULTISAMPLE_NONE;
	d3dpp.MultiSampleQuality     =0;

	d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
	d3dpp.BackBufferFormat = d3ddm.Format;
    d3dpp.EnableAutoDepthStencil = TRUE;
    d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
	d3dpp.Flags              = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL;
	d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;

	if(theViewer.getFullscreen())
	{
		d3dpp.Windowed   = FALSE;
		d3dpp.BackBufferWidth=theViewer.getWidth();
		d3dpp.BackBufferHeight=theViewer.getHeight();

	}

	D3DCAPS9 Caps;
	g_pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&Caps);

	if((Caps.TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3) == 0)
	{
		MessageBox(hWnd,
              "Your 3D Card don't support DOT3 operation, bumpmapping is disabled",
		      "Warning",MB_OK);

		g_bCanDot3=false;
	}

	if(Caps.VertexShaderVersion >= D3DVS_VERSION(1,1))
	{
        if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
                                  D3DCREATE_HARDWARE_VERTEXPROCESSING,
                                  &d3dpp, &g_pD3DDevice ) ) )
			return E_FAIL;
	}
	else
	{
		if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
                                  D3DCREATE_SOFTWARE_VERTEXPROCESSING,
                                  &d3dpp, &g_pD3DDevice ) ) )
			return E_FAIL;
	}

	
	return S_OK;
}
开发者ID:AAnguix,项目名称:TTOD_Engine,代码行数:60,代码来源:main.cpp

示例10: Clear

//=============================================================================================================
void Game::Reset(const std::string& stagefile)
{
	Clear();
	UnapplyPowerup();

	savedvars.health = avatar.Health;
	savedvars.maxhealth = avatar.MaxHealth;
	savedvars.integrity = avatar.Integrity;
	savedvars.maxintegrity = avatar.MaxIntegrity;
	savedvars.score = hud.Score;

	avatar.InitialPosition = D3DXVECTOR2(0, (GameVariables::ScreenHeight - avatar.Image->Size.y) * 0.5f);
	avatar.Bounds = D3DXVECTOR4(0, hud.Panel->Size.y, GameVariables::ScreenWidth, GameVariables::ScreenHeight - hud.Panel->Size.y);

	if( !distort && rendertarget && rendersurface && GameVariables::EnableShaders )
	{
		if( game->DeviceCaps.VertexShaderVersion >= D3DVS_VERSION(2, 0) &&
			game->DeviceCaps.PixelShaderVersion >= D3DPS_VERSION(2, 0) )
		{
			distort = game->Content.LoadMaterial("distort.fx");
			GameVariables::EnableShaders = (distort != NULL);
		}
	}

	if( !script.Compile(stagefile, *this) )
		game->Application.Close();

	RestartLevel();
}
开发者ID:asylum2010,项目名称:DummyFramework,代码行数:30,代码来源:game.cpp

示例11: mDevice

Dx9BackEnd::Dx9BackEnd(Context *context, IDirect3DDevice9 *d3ddevice)
    : mDevice(d3ddevice)
{
    mDevice->AddRef();

    for (int i = 0; i < MAX_VERTEX_ATTRIBS; ++i)
    {
        mAppliedAttribEnabled[i] = true;
        mStreamFrequency[i] = STREAM_FREQUENCY_UNINSTANCED;
    }

    mStreamFrequency[MAX_VERTEX_ATTRIBS] = STREAM_FREQUENCY_UNINSTANCED;

    D3DCAPS9 caps = context->getDeviceCaps();

    IDirect3D9 *d3dObject;
    mDevice->GetDirect3D(&d3dObject);

    D3DADAPTER_IDENTIFIER9 ident;
    d3dObject->GetAdapterIdentifier(caps.AdapterOrdinal, 0, &ident);
    d3dObject->Release();

    // Instancing is mandatory for all HW with SM3 vertex shaders, but avoid hardware where it does not work.
    mUseInstancingForStrideZero = (caps.VertexShaderVersion >= D3DVS_VERSION(3, 0) && ident.VendorId != 0x8086);
    mSupportIntIndices = (caps.MaxVertexIndex >= (1 << 16));

    checkVertexCaps(caps.DeclTypes);
}
开发者ID:pelegri,项目名称:WebKit-PlayBook,代码行数:28,代码来源:dx9.cpp

示例12: Direct3DCreate9

void Graphics::initialize(HWND hw, int w, int h, bool full)
{
    hwnd = hw;
    width = w;
    height = h;
    fullscreen = full;

    direct3d = Direct3DCreate9(D3D_SDK_VERSION);
    if (direct3d == NULL)
        throw(GameError(gameErrorNS::FATAL_ERROR, "Error initializing Direct3D"));

    initD3Dpp();       
    if(fullscreen)     
    {
        if(isAdapterCompatible())   
            d3dpp.FullScreen_RefreshRateInHz = pMode.RefreshRate;
        else
            throw(GameError(gameErrorNS::FATAL_ERROR, 
            "The graphics device does not support the specified resolution and/or format."));
    }

    D3DCAPS9 caps;
    DWORD behavior;
    result = direct3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps);
    if( (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0 ||
            caps.VertexShaderVersion < D3DVS_VERSION(1,1) )
        behavior = D3DCREATE_SOFTWARE_VERTEXPROCESSING;  
    else
        behavior = D3DCREATE_HARDWARE_VERTEXPROCESSING;  

    result = direct3d->CreateDevice(
        D3DADAPTER_DEFAULT,
        D3DDEVTYPE_HAL,
        hwnd,
        behavior,
        &d3dpp, 
        &device3d);

    if (FAILED(result))
        throw(GameError(gameErrorNS::FATAL_ERROR, "Error creating Direct3D device"));
 
    result = D3DXCreateSprite(device3d, &sprite);
    if (FAILED(result))
        throw(GameError(gameErrorNS::FATAL_ERROR, "Error creating Direct3D sprite"));

    device3d->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);
    device3d->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
    device3d->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
    if( FAILED( direct3d->CheckDeviceFormat(caps.AdapterOrdinal,
                                            caps.DeviceType,  
                                            d3dpp.BackBufferFormat,  
                                            D3DUSAGE_DEPTHSTENCIL, 
                                            D3DRTYPE_SURFACE,
                                            D3DFMT_D24S8 ) ) )
        stencilSupport = false;
    else
        stencilSupport = true;
    device3d->CreateQuery(D3DQUERYTYPE_OCCLUSION, &pOcclusionQuery);
}
开发者ID:KWJYP,项目名称:M.J_Physical_GameStudio_Engine,代码行数:59,代码来源:graphics.cpp

示例13: ModifyDeviceSettings

//--------------------------------------------------------------------------------------
// This callback function is called immediately before a device is created to allow the 
// application to modify the device settings. The supplied pDeviceSettings parameter 
// contains the settings that the framework has selected for the new device, and the 
// application can make any desired changes directly to this structure.  Note however that 
// DXUT will not correct invalid device settings so care must be taken 
// to return valid device settings, otherwise IDirect3D9::CreateDevice() will fail.  
//--------------------------------------------------------------------------------------
bool CALLBACK ModifyDeviceSettings( DXUTDeviceSettings* pDeviceSettings, void* pUserContext )
{
    assert( DXUT_D3D9_DEVICE == pDeviceSettings->ver );

    HRESULT hr;
    IDirect3D9* pD3D = DXUTGetD3D9Object();
    D3DCAPS9 caps;

    V( pD3D->GetDeviceCaps( pDeviceSettings->d3d9.AdapterOrdinal,
                            pDeviceSettings->d3d9.DeviceType,
                            &caps ) );

    // If device doesn't support HW T&L or doesn't support 1.1 vertex shaders in HW 
    // then switch to SWVP.
    if( ( caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ) == 0 ||
        caps.VertexShaderVersion < D3DVS_VERSION( 1, 1 ) )
    {
        pDeviceSettings->d3d9.BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
    }

    // Debugging vertex shaders requires either REF or software vertex processing 
    // and debugging pixel shaders requires REF.  
#ifdef DEBUG_VS
    if( pDeviceSettings->d3d9.DeviceType != D3DDEVTYPE_REF )
    {
        pDeviceSettings->d3d9.BehaviorFlags &= ~D3DCREATE_HARDWARE_VERTEXPROCESSING;
        pDeviceSettings->d3d9.BehaviorFlags &= ~D3DCREATE_PUREDEVICE;
        pDeviceSettings->d3d9.BehaviorFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;
    }
#endif
#ifdef DEBUG_PS
    pDeviceSettings->d3d9.DeviceType = D3DDEVTYPE_REF;
#endif

    // Enable anti-aliasing for HAL devices which support it
    CD3D9Enumeration* pEnum = DXUTGetD3D9Enumeration();
    CD3D9EnumDeviceSettingsCombo* pCombo = pEnum->GetDeviceSettingsCombo( &pDeviceSettings->d3d9 );

    if( pDeviceSettings->d3d9.DeviceType == D3DDEVTYPE_HAL &&
        pCombo->multiSampleTypeList.Contains( D3DMULTISAMPLE_4_SAMPLES ) )
    {
        pDeviceSettings->d3d9.pp.MultiSampleType = D3DMULTISAMPLE_4_SAMPLES;
        pDeviceSettings->d3d9.pp.MultiSampleQuality = 0;
    }
    // For the first device created if its a REF device, optionally display a warning dialog box
    static bool s_bFirstTime = true;
    if( s_bFirstTime )
    {
        s_bFirstTime = false;
        if( pDeviceSettings->d3d9.DeviceType == D3DDEVTYPE_REF )
            DXUTDisplaySwitchingToREFWarning( pDeviceSettings->ver );
    }

    return true;
}
开发者ID:KNeal,项目名称:Oculus,代码行数:63,代码来源:MeshFromObj.cpp

示例14: switch

int D3D9DeviceCaps::VertexShaderVersion()
{
    switch (mCaps.VertexShaderVersion)
    {
    case D3DVS_VERSION(3, 0):
        return (int)SP_VS;

    default:
        return 0;
    }
}
开发者ID:ak4hige,项目名称:myway3d,代码行数:11,代码来源:MWD3D9DeviceCaps.cpp

示例15: D3DVS_VERSION

//-----------------------------------------------------------------------------
// Name: ConfirmDevice()
// Desc: Called during device intialization, this code checks the device
//       for some minimum set of capabilities
//-----------------------------------------------------------------------------
HRESULT CMyD3DApplication::ConfirmDevice( D3DCAPS8* pCaps, DWORD dwBehavior,
                                          D3DFORMAT Format )
{
    if( !(dwBehavior & D3DCREATE_SOFTWARE_VERTEXPROCESSING) &&
        !(pCaps->VertexShaderVersion >= D3DVS_VERSION(1, 0)) )
    {
        return E_FAIL;
    }

    return S_OK;
}
开发者ID:grakidov,项目名称:Render3D,代码行数:16,代码来源:spheremap.cpp


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