• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MAKEFOURCC函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: v4w_open_videodevice


//.........这里部分代码省略.........
		ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_720P_W, MS_VIDEO_SIZE_720P_H);
	else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_1080P_W, MS_VIDEO_SIZE_1080P_H, &pPinCategory)==0)
		ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_1080P_W, MS_VIDEO_SIZE_1080P_H);
	else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_4SIF_W, MS_VIDEO_SIZE_4SIF_H, &pPinCategory)==0)
		ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_4SIF_W, MS_VIDEO_SIZE_4SIF_H);
	else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_SVGA_W, MS_VIDEO_SIZE_SVGA_H, &pPinCategory)==0)
		ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_SVGA_W, MS_VIDEO_SIZE_SVGA_H);
	else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_XGA_W, MS_VIDEO_SIZE_XGA_H, &pPinCategory)==0)
		ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_XGA_W, MS_VIDEO_SIZE_XGA_H);
	else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_WXGA_W, MS_VIDEO_SIZE_WXGA_H, &pPinCategory)==0)
		ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_WXGA_W, MS_VIDEO_SIZE_WXGA_H);
	else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_HDTVP_W, MS_VIDEO_SIZE_HDTVP_H, &pPinCategory)==0)
		ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_HDTVP_W, MS_VIDEO_SIZE_HDTVP_H);
	else
	{
		ms_error("No supported size found for format.");
		/* size not supported? */
		return -9;
	}

	// get DXFilter
	s->m_pDXFilter = new CDXFilter(NULL, &hr, FALSE);
	if(s->m_pDXFilter==NULL)
	{
		return -10;
	}
	s->m_pDXFilter->AddRef();

	CMediaType mt;
	mt.SetType(&MEDIATYPE_Video);

	GUID m = MEDIASUBTYPE_RGB24;
	if (s->pix_fmt == MS_YUV420P)
		m = (GUID)FOURCCMap(MAKEFOURCC('I','4','2','0'));
	else if (s->pix_fmt == MS_YUY2)
		m = MEDIASUBTYPE_YUY2;
	else if (s->pix_fmt == MS_YUYV)
		m = MEDIASUBTYPE_YUYV;
	else if (s->pix_fmt == MS_UYVY)
		m = MEDIASUBTYPE_UYVY;
	else if (s->pix_fmt == MS_RGB24)
		m = MEDIASUBTYPE_RGB24;
	mt.SetSubtype(&m);

	mt.formattype = FORMAT_VideoInfo;
	mt.SetTemporalCompression(FALSE);

	VIDEOINFO *pvi = (VIDEOINFO *)
		mt.AllocFormatBuffer(sizeof(VIDEOINFO));
	if (NULL == pvi)
		return -11;
	ZeroMemory(pvi, sizeof(VIDEOINFO));

	if (s->pix_fmt == MS_YUV420P)
		pvi->bmiHeader.biCompression = MAKEFOURCC('I','4','2','0');
	else if (s->pix_fmt == MS_YUY2)
		pvi->bmiHeader.biCompression = MAKEFOURCC('Y','U','Y','2');
	else if (s->pix_fmt == MS_YUYV)
		pvi->bmiHeader.biCompression = MAKEFOURCC('Y','U','Y','V');
	else if (s->pix_fmt == MS_UYVY)
		pvi->bmiHeader.biCompression = MAKEFOURCC('U','Y','V','Y');
	else if (s->pix_fmt == MS_RGB24)
		pvi->bmiHeader.biCompression = BI_RGB;

	if (s->pix_fmt == MS_YUV420P)
		pvi->bmiHeader.biBitCount = 12;
开发者ID:JonathanRadesa,项目名称:mediastreamer2,代码行数:67,代码来源:winvideods.c


示例2: MAKEFOURCC

    int osd_width;                  /**< current width of the OSD */
    int osd_height;                 /**< current height of the OSD */
    int osd_texture_width;          /**< current width of the OSD texture */
    int osd_texture_height;         /**< current height of the OSD texture */
} *priv;

typedef struct {
    const unsigned int  mplayer_fmt;   /**< Given by MPlayer */
    const D3DFORMAT     fourcc;        /**< Required by D3D's test function */
} struct_fmt_table;

/* Map table from reported MPlayer format to the required
   fourcc. This is needed to perform the format query. */

static const struct_fmt_table fmt_table[] = {
    {IMGFMT_YV12,  MAKEFOURCC('Y','V','1','2')},
    {IMGFMT_I420,  MAKEFOURCC('I','4','2','0')},
    {IMGFMT_IYUV,  MAKEFOURCC('I','Y','U','V')},
    {IMGFMT_YVU9,  MAKEFOURCC('Y','V','U','9')},
    {IMGFMT_YUY2,  D3DFMT_YUY2},
    {IMGFMT_UYVY,  D3DFMT_UYVY},
    {IMGFMT_BGR32, D3DFMT_X8R8G8B8},
    {IMGFMT_RGB32, D3DFMT_X8B8G8R8},
    {IMGFMT_BGR24, D3DFMT_R8G8B8}, //untested
    {IMGFMT_BGR16, D3DFMT_R5G6B5},
    {IMGFMT_BGR15, D3DFMT_X1R5G5B5},
    {IMGFMT_BGR8 , D3DFMT_R3G3B2}, //untested
};

#define DISPLAY_FORMAT_TABLE_ENTRIES (sizeof(fmt_table) / sizeof(fmt_table[0]))
开发者ID:HermiG,项目名称:mplayer2,代码行数:30,代码来源:vo_direct3d.c


示例3: NineQuery9_GetData

HRESULT WINAPI
NineQuery9_GetData( struct NineQuery9 *This,
                    void *pData,
                    DWORD dwSize,
                    DWORD dwGetDataFlags )
{
    struct pipe_context *pipe = This->base.device->pipe;
    boolean ok = !This->pq;
    unsigned i;
    union pipe_query_result presult;
    union nine_query_result nresult;

    user_assert(This->state != NINE_QUERY_STATE_RUNNING, D3DERR_INVALIDCALL);
    user_assert(dwSize == 0 || pData, D3DERR_INVALIDCALL);
    user_assert(dwGetDataFlags == 0 ||
                dwGetDataFlags == D3DGETDATA_FLUSH, D3DERR_INVALIDCALL);

    if (!This->pq) {
        DBG("No pipe query available.\n");
        if (!dwSize)
           return S_OK;
    }
    if (This->state == NINE_QUERY_STATE_FRESH)
        return S_OK;

    if (!ok) {
        ok = pipe->get_query_result(pipe, This->pq, FALSE, &presult);
        if (!ok) {
            if (dwGetDataFlags) {
                if (This->state != NINE_QUERY_STATE_FLUSHED)
                    pipe->flush(pipe, NULL, 0);
                This->state = NINE_QUERY_STATE_FLUSHED;
            }
            return S_FALSE;
        }
    }
    if (!dwSize)
        return S_OK;

    switch (This->type) {
    case D3DQUERYTYPE_EVENT:
        nresult.b = presult.b;
        break;
    case D3DQUERYTYPE_OCCLUSION:
        nresult.dw = presult.u64;
        break;
    case D3DQUERYTYPE_TIMESTAMP:
        nresult.u64 = presult.u64;
        break;
    case D3DQUERYTYPE_TIMESTAMPDISJOINT:
        nresult.b = presult.timestamp_disjoint.disjoint;
        break;
    case D3DQUERYTYPE_TIMESTAMPFREQ:
        nresult.u64 = presult.timestamp_disjoint.frequency;
        break;
    case D3DQUERYTYPE_VERTEXSTATS:
        nresult.vertexstats.NumRenderedTriangles =
            presult.pipeline_statistics.c_invocations;
        nresult.vertexstats.NumExtraClippingTriangles =
            presult.pipeline_statistics.c_primitives;
        break;
    /* Thse might be doable with driver-specific queries; dummy for now. */
    case D3DQUERYTYPE_BANDWIDTHTIMINGS:
        nresult.bandwidth.MaxBandwidthUtilized = 1.0f;
        nresult.bandwidth.FrontEndUploadMemoryUtilizedPercent = 0.5f;
        nresult.bandwidth.VertexRateUtilizedPercent = 0.75f;
        nresult.bandwidth.TriangleSetupRateUtilizedPercent = 0.75f;
        nresult.bandwidth.FillRateUtilizedPercent = 1.0f;
        break;
    case D3DQUERYTYPE_VERTEXTIMINGS:
    case D3DQUERYTYPE_PIXELTIMINGS:
        nresult.stage.MemoryProcessingPercent = 0.5f;
        nresult.stage.ComputationProcessingPercent = 0.5f;
        break;
    case D3DQUERYTYPE_VCACHE:
        /* Are we supposed to fill this in ? */
        nresult.vcache.Pattern = MAKEFOURCC('C', 'A', 'C', 'H');
        nresult.vcache.OptMethod = 1;
        nresult.vcache.CacheSize = 32 << 10;
        nresult.vcache.MagicNumber = 0xdeadcafe;
        break;
    case D3DQUERYTYPE_RESOURCEMANAGER:
        /* We could record some of these in the device ... */
        for (i = 0; i < D3DRTYPECOUNT; ++i) {
            nresult.rm.stats[i].bThrashing = FALSE;
            nresult.rm.stats[i].ApproxBytesDownloaded = 0;
            nresult.rm.stats[i].NumEvicts = 0;
            nresult.rm.stats[i].NumVidCreates = 0;
            nresult.rm.stats[i].LastPri = 0;
            nresult.rm.stats[i].NumUsed = 1;
            nresult.rm.stats[i].NumUsedInVidMem = 1;
            nresult.rm.stats[i].WorkingSet = 1;
            nresult.rm.stats[i].WorkingSetBytes = 1 << 20;
            nresult.rm.stats[i].TotalManaged = 1;
            nresult.rm.stats[i].TotalBytes = 1 << 20;
        }
        break;
    case D3DQUERYTYPE_PIPELINETIMINGS:
        nresult.pipe.VertexProcessingTimePercent = 0.4f;
        nresult.pipe.PixelProcessingTimePercent = 0.4f;
//.........这里部分代码省略.........
开发者ID:Thermionix,项目名称:Mesa-3D,代码行数:101,代码来源:query9.c


示例4: sizeof

    DWORD dwSize;
    DWORD dwFlags;
    DWORD dwFourCC;
    DWORD dwRGBBitCount;
    DWORD dwRBitMask;
    DWORD dwGBitMask;
    DWORD dwBBitMask;
    DWORD dwABitMask;
};

#define DDS_FOURCC 0x00000004  // DDPF_FOURCC
#define DDS_RGB    0x00000040  // DDPF_RGB
#define DDS_RGBA   0x00000041  // DDPF_RGB | DDPF_ALPHAPIXELS

const DDS_PIXELFORMAT DDSPF_DXT1 =
    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 };

const DDS_PIXELFORMAT DDSPF_DXT2 =
    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','2'), 0, 0, 0, 0, 0 };

const DDS_PIXELFORMAT DDSPF_DXT3 =
    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','3'), 0, 0, 0, 0, 0 };

const DDS_PIXELFORMAT DDSPF_DXT4 =
    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','4'), 0, 0, 0, 0, 0 };

const DDS_PIXELFORMAT DDSPF_DXT5 =
    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','5'), 0, 0, 0, 0, 0 };

const DDS_PIXELFORMAT DDSPF_A8R8G8B8 =
    { sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 };
开发者ID:galek,项目名称:SoftOcclude,代码行数:31,代码来源:CPUTTextureDX11.cpp


示例5: ADM_info

/**
    \fn changeZoom
*/
bool dxvaRender::init( GUI_WindowInfo *  window, uint32_t w, uint32_t h,renderZoom zoom)
{
    ADM_info("Initializing dxva2/D3D render\n");
    info=*window;
    baseInit(w,h,zoom);

    windowId=(HWND)window->systemWindowId;

    if(!d3dHandle)
    {
        ADM_warning("No D3DHandle\n");
        return false;
    }

    if (ADM_FAILED(IDirect3D9_GetAdapterDisplayMode(d3dHandle,
                                                D3DADAPTER_DEFAULT,
                                                &displayMode)))
    {
        ADM_warning("Dxv2/D3D Render: Cannot get display mode\n");
        return 0;
    }

    D3DCAPS9 deviceCapabilities;
    ADM_info("D3D Checking device capabilities\n");
    if (ADM_FAILED(IDirect3D9_GetDeviceCaps(d3dHandle,
                                        D3DADAPTER_DEFAULT,
                                        D3DDEVTYPE_HAL,
                                        &deviceCapabilities)))
    {
      ADM_warning("Cannot get device capabilities");
      return false;
    }
    int texture = deviceCapabilities.TextureCaps;
    ADM_info("Power of 2 : %d\n",  (texture & D3DPTEXTURECAPS_POW2) &&   !(texture & D3DPTEXTURECAPS_NONPOW2CONDITIONAL));
    ADM_info("Square only: %d\n",  (texture & D3DPTEXTURECAPS_SQUAREONLY));



      // Check if we support YV12
    D3DFORMAT fmt=displayMode.Format;
    D3DFORMAT yv12=(D3DFORMAT)MAKEFOURCC('Y','V','1','2');
    if (ADM_FAILED(IDirect3D9_CheckDeviceFormatConversion(   d3dHandle, // adapter
                                                         D3DADAPTER_DEFAULT, // device type
                                                         D3DDEVTYPE_HAL, // adapter format
                                                         yv12, // render target format
                                                         fmt)))  // depth stencil format
    {
        useYV12=false;
        ADM_info("D3D YV12 not supported\n");
    }
    else
    {
        useYV12=true;
        ADM_info("D3D YV12 is supported\n");
    }



    if(!setup())
    {
      ADM_warning("Dxva/D3D setup failed\n");
      return false;
    }
    videoWidget=(ADM_Qvideo *)info.widget;
    videoWidget->useExternalRedraw(true); // deactivate Qt Double buffering
    videoWidget->setDrawer(this);

    ADM_info("Dxva (D3D) init successful, dxva render. w=%d, h=%d,zoom=%d, displayWidth=%d, displayHeight=%d\n",(int)w,(int)h,(int)zoom,(int)displayWidth,(int)displayHeight);
    return true;
}
开发者ID:TotalCaesar659,项目名称:avidemux2,代码行数:73,代码来源:GUI_dxva2Render.cpp


示例6: LPSTR

//--------------------------------------------------------------------------------------------------------------
SPS*	CResourceManager::_CreatePS			(LPCSTR name)
{
	LPSTR N				= LPSTR(name);
	map_PS::iterator I	= m_ps.find	(N);
	if (I!=m_ps.end())	return		I->second;
	else
	{
		SPS*	_ps					=	xr_new<SPS>	();
		_ps->dwFlags				|=	xr_resource_flagged::RF_REGISTERED;
		m_ps.insert					(mk_pair(_ps->set_name(name),_ps));
		if (0==stricmp(name,"null"))	{
			_ps->ps				= NULL;
			return _ps;
		}

		// Open file
		includer					Includer;
		string_path					cname;
		strconcat					(sizeof(cname), cname,::Render->getShaderPath(),name,".ps");
		FS.update_path				(cname,	"$game_shaders$", cname);

		// duplicate and zero-terminate
		IReader*		R		= FS.r_open(cname);
		R_ASSERT2				(R,cname);
		u32				size	= R->length();
		char*			data	= xr_alloc<char>(size + 1);
		CopyMemory			(data,R->pointer(),size);
		data[size]				= 0;
		FS.r_close				(R);

		// Select target
		LPCSTR						c_target	= "ps_2_0";
		LPCSTR						c_entry		= "main";
		if (strstr(data,"main_ps_1_1"))			{ c_target = "ps_1_1"; c_entry = "main_ps_1_1";	}
		if (strstr(data,"main_ps_1_2"))			{ c_target = "ps_1_2"; c_entry = "main_ps_1_2";	}
		if (strstr(data,"main_ps_1_3"))			{ c_target = "ps_1_3"; c_entry = "main_ps_1_3";	}
		if (strstr(data,"main_ps_1_4"))			{ c_target = "ps_1_4"; c_entry = "main_ps_1_4";	}
		if (strstr(data,"main_ps_2_0"))			{ c_target = "ps_2_0"; c_entry = "main_ps_2_0";	}

		// Compile
		LPD3DXBUFFER				pShaderBuf	= NULL;
		LPD3DXBUFFER				pErrorBuf	= NULL;
		LPD3DXSHADER_CONSTANTTABLE	pConstants	= NULL;
		HRESULT						_hr			= S_OK;
		_hr = ::Render->shader_compile	(name,data,size, NULL, &Includer, c_entry, c_target, D3DXSHADER_DEBUG | D3DXSHADER_PACKMATRIX_ROWMAJOR /*| D3DXSHADER_PREFER_FLOW_CONTROL*/, &pShaderBuf, &pErrorBuf, NULL);
		//_hr = D3DXCompileShader		(text,text_size, NULL, &Includer, c_entry, c_target, D3DXSHADER_DEBUG | D3DXSHADER_PACKMATRIX_ROWMAJOR, &pShaderBuf, &pErrorBuf, NULL);
		xr_free						(data);
		
		LPCSTR last_error = "";

		if (SUCCEEDED(_hr))
		{
			if (pShaderBuf)
			{
				_hr = HW.pDevice->CreatePixelShader	((DWORD*)pShaderBuf->GetBufferPointer(), &_ps->ps);
				if (SUCCEEDED(_hr))	{
					LPCVOID			data		= NULL;
					_hr	= D3DXFindShaderComment	((DWORD*)pShaderBuf->GetBufferPointer(),MAKEFOURCC('C','T','A','B'),&data,NULL);
					if (SUCCEEDED(_hr) && data)
					{
						pConstants				= LPD3DXSHADER_CONSTANTTABLE(data);
						_ps->constants.parse	(pConstants,0x1);
					} 
					else	
						_hr = E_FAIL;
				}
			}
			else	
				_hr = E_FAIL;
		}else
		{
			if (pErrorBuf)
				last_error = (LPCSTR)pErrorBuf->GetBufferPointer();
		}

		// Real Wolf.10.12.2014
		string1024 buff;
		if (FAILED(_hr))
		{
			if (xr_strlen(last_error))
				sprintf_s(buff, 1023, "ќшибка компил¤ции шейдера %s: %s ", name, last_error);
			else
				sprintf_s(buff, 1023, "ќшибка компил¤ции шейдера %s. ¬озможна ошибка в скрипте, или\n видеокарта не поддерживает пиксельные шейдеры 1.1", name);

			Msg(buff);
		}

		pConstants = NULL;
		_RELEASE(pShaderBuf);
		_RELEASE(pErrorBuf);

		CHECK_OR_EXIT		(
			!FAILED(_hr),
			make_string(buff)
		);
		return			_ps;
	}
}
开发者ID:Karlan88,项目名称:xray,代码行数:99,代码来源:ResourceManager_Resources.cpp


示例7: timeGetTime

void CREvent::Display()
{
	if(m_pPlayer){
		m_SelectSence->RenderLayerBack();
		render::Interface *pInterface = render::Interface::GetInstance();
		render::Interface::Layer3D *pLayer3D   = pInterface->GetLayer3D();
		DWORD dwCurrentTime = timeGetTime();
		// 显示角色
		if (m_pPlayer && m_pPlayer->GetDisplayModel()
			&& m_pPlayer->GetDisplayModel()->GetLoadState() == Load_Did)
		{
			static WORD dwState[] = 
			{
				CShape::STATE_PEACE,		// 取武器
				CShape::STATE_FIGHT,		// 挥舞
				CShape::STATE_FIGHT,		// 站定
			};
			static WORD dwAct[] = 
			{
				CShape::ACT_SEL_X0,			// 取武器
				CShape::ACT_SEL_X1,			// 挥舞
				CShape::ACT_SEL_X2,			// 站定
			};

			// 判断角色模型旋转
			if (m_bRoleLeftRotate)
				s_RolePos[3] += 0.1f;

			if (m_bRoleRightRotate)
				s_RolePos[3] -= 0.1f;

			//判断播放结束
			CDisplayModel *pDisplayModel = m_pPlayer->GetDisplayModel();
			AnimInfo *pAnimInfo = m_pPlayer->GetAnimInfo();
			pAnimInfo->GetActionInfo()->bStayToLastFrame = false;

			pAnimInfo->GetActionInfo()->bCurActionLooped = TRUE;
			pAnimInfo->SetCurrentTime(dwCurrentTime);
			if (pAnimInfo->GetActionInfo()->dwCurActionLoopCount > 10 && pAnimInfo->GetActionInfo()->dwCurAction == MAKEFOURCC('E','I','0','0'))
			{
				pAnimInfo->GetActionInfo()->bInterpolation = TRUE;
				pAnimInfo->GetActionInfo()->dwOldAction = pAnimInfo->GetActionInfo()->dwCurAction;
				pAnimInfo->GetActionInfo()->dwOldActionTimeElapse = pAnimInfo->GetActionInfo()->dwCurActionElapseTime;
				pAnimInfo->GetActionInfo()->fOldActionSpeedRate = pAnimInfo->GetActionInfo()->fCurActionSpeedRate;
				pAnimInfo->GetActionInfo()->dwInterpolationElapseTime = 0;
				pAnimInfo->GetActionInfo()->dwInterpolationStartTime  = dwCurrentTime;
				pAnimInfo->GetActionInfo()->dwInterpolationTimeLength = 240;
				pAnimInfo->GetActionInfo()->dwCurAction = MAKEFOURCC('E','I','0','0');
				pAnimInfo->GetActionInfo()->dwCurActionLoopCount = 0;
			}
			/* else if (pAnimInfo->GetActionInfo()->dwCurActionLoopCount > 0 && pAnimInfo->GetActionInfo()->dwCurAction == MAKEFOURCC('E','I','0','0'))
			{
			pAnimInfo->GetActionInfo()->bInterpolation = TRUE;
			pAnimInfo->GetActionInfo()->dwOldAction = pAnimInfo->GetActionInfo()->dwCurAction;
			pAnimInfo->GetActionInfo()->dwOldActionTimeElapse = pAnimInfo->GetActionInfo()->dwCurActionElapseTime;
			pAnimInfo->GetActionInfo()->fOldActionSpeedRate = pAnimInfo->GetActionInfo()->fCurActionSpeedRate;
			pAnimInfo->GetActionInfo()->dwInterpolationElapseTime = 0;
			pAnimInfo->GetActionInfo()->dwInterpolationStartTime  = dwCurrentTime;
			pAnimInfo->GetActionInfo()->dwInterpolationTimeLength = 240;
			pAnimInfo->GetActionInfo()->dwCurAction = MAKEFOURCC('E','I','0','0');
			pAnimInfo->GetActionInfo()->dwCurActionLoopCount = 0;
			}*/
			else
			{
				if (pAnimInfo->GetActionInfo()->dwCurAction != MAKEFOURCC('E','I','0','0')&&pAnimInfo->GetActionInfo()->dwCurAction != MAKEFOURCC('E','B','0','0'))
				{
					pAnimInfo->GetActionInfo()->dwCurAction = MAKEFOURCC('E','I','0','0');
					pAnimInfo->GetActionInfo()->dwCurActionLoopCount = 0;
				}
			}

			//this->RoleLeftRotate();

			//bool bDisplayFinish = (pAnimInfo->GetActionInfo()->dwCurActionLoopCount > 0);
			//if (bDisplayFinish)
			//{
			//	// 出招
			//	if (m_iCurrentAction < 2)
			//	{
			//		m_iCurrentAction++;
			//		g_bForceUpdate = true;
			//		pSelectedPlayer->SetAction(dwAct[m_iCurrentAction]);
			//	}
			//	else
			//	{
			//		pSelectedPlayer->SetAction(dwAct[m_iCurrentAction]);
			//		g_bForceUpdate = true;
			//	}
			//}

			// 显示坐标
			if (g_bDebug)
			{
				char str[256];
				sprintf(str, "%f, %f, %f (%f)", s_RolePos[0], s_RolePos[1], s_RolePos[2], m_pPlayer->GetNowDir());
				GetGame()->OutPutText(0, 0, str, lstrlen(str), D3DCOLOR_ARGB(255,0,255,0));
			}
			// 渲染简单阴影
			render::Camera *pCamera = m_SelectSence->GetCamera();
			pDisplayModel->SetDirLightEnable(false);
//.........这里部分代码省略.........
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:101,代码来源:CreateRoleEvent.cpp


示例8: DP


//.........这里部分代码省略.........
	if(m_cam_hnd ==INVALID_HANDLE_VALUE)
	{
		DP("[GFXSAMSUNG]Open PST1 Fail\n");
		return E_FAIL;
	}

#ifdef SAMSUNG_2416
	if( !ExtEscape( ::GetDC( NULL ), IOCTL_WIN1_CLOSE, 0, NULL, 0, NULL) )
	{
		RETAILMSG(1,(L"$$$$$$ close win1 Failed ! $$$$$$$$$$$$$$$$$$\n"));
	}
#endif


	if(!DeviceIoControl(m_cam_hnd, (DWORD)IOCTL_POST_STOP,   //ֹͣת
			NULL, 0, NULL, 0, NULL, NULL))
	{
		DP("PST CamIF stop failed\n");
	}
	
	if(!DeviceIoControl(m_cam_hnd, (DWORD)IOCTL_POST_GETHWSTATE,
			NULL, 0, &CamIFState, sizeof(DWORD), NULL, NULL))
	{
		DP("PST Get CamIF State false!\r\n");
	//	return E_FAIL;
	}

	if(CamIFState == CAMIF_IDLE_STATE)
	{

#ifdef SAMSUNG_2416
			m_uAlpha = 0xf;
			if(!ExtEscape( ::GetDC( NULL ), IOCTL_WIN1_SETALPHA, sizeof(m_uAlpha),(LPCSTR)&m_uAlpha,0,NULL))
		   {
			   RETAILMSG(1,(L"$$$$$$ SetAlpha Failed ! $$$$$$$$$$$$$$$$$$\n"));
		   }

			if(!ExtEscape( ::GetDC( NULL ), IOCTL_WIN1_SETSIZE, sizeof(m_sWin1Size),(LPCSTR)&m_sWin1Size,0,NULL))
		   {
				RETAILMSG(1,(L"$$$$$$ SetWin1Size Failed ! $$$$$$$$$$$$$$$$$$\n"));	
		   }
#endif

		if(!DeviceIoControl(m_cam_hnd, (DWORD)IOCTL_POST_INIT,
			&m_open_para, sizeof(m_open_para), NULL, 0, NULL, NULL))
		{
			DP("PST IOCTROL FAIL!\r\n");
			return E_FAIL;
		}
	}
	else
	{
		DP("PST CamIF is not idle!\r\n");
		return E_FAIL;
	}

#ifdef SAMSUNG_2416
	m_pInputBuff = (BYTE*)malloc(m_dwWidth* m_dwHeight *4 );
	m_pOutputBuff = (BYTE*)malloc(m_open_para.nDestWidth* m_open_para.nDestHeight*4);
	if((m_pInputBuff == NULL) || (m_pOutputBuff  == NULL))
		return E_FAIL;
	if( !ExtEscape( ::GetDC( NULL ), IOCTL_WIN1_OPEN, 0, NULL, 0, NULL) )
   {
        RETAILMSG(1,(L"$$$$$$ open win1  Failed ! $$$$$$$$$$$$$$$$$$\n"));
   }

#else

	#ifdef SAMSUNG_2450_LEADER_INTL
		m_pInputBuff = (BYTE*)malloc(m_dwWidth* m_dwHeight *4 );
		m_pOutputBuff = (BYTE*)malloc(480*272*4);
		if((m_pInputBuff == NULL) || (m_pOutputBuff  == NULL))
			return E_FAIL;
		if( !ExtEscape( ::GetDC( NULL ), IOCTL_WIN1_OPEN, 0, NULL, 0, NULL) )
	   {
	        RETAILMSG(1,(L"$$$$$$ open win1  Failed ! $$$$$$$$$$$$$$$$$$\n"));
	   }

	#else
		if(!DeviceIoControl(m_cam_hnd, (DWORD)IOCTL_POST_GETINPUTBUFFER,  //get input buffer
				NULL, 0, &m_pInputBuff,sizeof(m_pInputBuff), NULL, NULL))
		{
			DP("get input buffer FAIL!");
			return E_FAIL;
		}

		if(!DeviceIoControl(m_cam_hnd, (DWORD)IOCTL_POST_GETOUTPUTBUFFER,  //get OUTput buffer
				NULL, 0, &m_pOutputBuff,sizeof(m_pOutputBuff), NULL, NULL))
		{
			DP("get output buffer FAIL!");
			return E_FAIL;
		}
	#endif
#endif
	SetRect(&m_rectScn,0,0,GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN));

	m_dwFourCC = MAKEFOURCC('Y','V','1','2');
	m_bOpen = TRUE;
	return S_OK;
}
开发者ID:xuweiqiang,项目名称:LibVRPresent,代码行数:101,代码来源:GfxSamsung.cpp


示例9: Extract

static int Extract(vlc_va_t *external, picture_t *picture, AVFrame *ff)
{
    vlc_va_dxva2_t *va = vlc_va_dxva2_Get(external);
    LPDIRECT3DSURFACE9 d3d = (LPDIRECT3DSURFACE9)(uintptr_t)ff->data[3];

    if (!va->surface_cache.buffer)
        return VLC_EGENERIC;

    /* */
    assert(va->output == MAKEFOURCC('Y','V','1','2'));

    /* */
    D3DLOCKED_RECT lock;
    if (FAILED(IDirect3DSurface9_LockRect(d3d, &lock, NULL, D3DLOCK_READONLY))) {
        msg_Err(va->log, "Failed to lock surface");
        return VLC_EGENERIC;
    }

    if (va->render == MAKEFOURCC('Y','V','1','2') ||
        va->render == MAKEFOURCC('I','M','C','3')) {
        bool imc3 = va->render == MAKEFOURCC('I','M','C','3');
        size_t chroma_pitch = imc3 ? lock.Pitch : (lock.Pitch / 2);

        size_t pitch[3] = {
            lock.Pitch,
            chroma_pitch,
            chroma_pitch,
        };

        uint8_t *plane[3] = {
            (uint8_t*)lock.pBits,
            (uint8_t*)lock.pBits + pitch[0] * va->surface_height,
            (uint8_t*)lock.pBits + pitch[0] * va->surface_height
                                 + pitch[1] * va->surface_height / 2,
        };

        if (imc3) {
            uint8_t *V = plane[1];
            plane[1] = plane[2];
            plane[2] = V;
        }
        CopyFromYv12(picture, plane, pitch,
                     va->width, va->height,
                     &va->surface_cache);
    } else {
        assert(va->render == MAKEFOURCC('N','V','1','2'));
        uint8_t *plane[2] = {
            lock.pBits,
            (uint8_t*)lock.pBits + lock.Pitch * va->surface_height
        };
        size_t  pitch[2] = {
            lock.Pitch,
            lock.Pitch,
        };
        CopyFromNv12(picture, plane, pitch,
                     va->width, va->height,
                     &va->surface_cache);
    }

    /* */
    IDirect3DSurface9_UnlockRect(d3d);
    return VLC_SUCCESS;
}
开发者ID:Rodeo314,项目名称:tim-vlc-2.1,代码行数:63,代码来源:dxva2.c


示例10: ReadCollisionData

void ReadCollisionData(const char * c_pszFileName, int iBaseX, int iBaseY)
{
	FILE * fp = fopen(c_pszFileName, "rb");

	printf("Reading collision data file: %s\n", c_pszFileName);

	if (!fp)
	{
		printf("No collision data file: %s\n", c_pszFileName);
		return;
	}

	DWORD dwFourCC;
	fread(&dwFourCC, sizeof(DWORD), 1, fp);

	if (dwFourCC != MAKEFOURCC('M', '2', 'C', 'D'))
	{
		printf("Not a collision data file: %s", c_pszFileName);
		fclose(fp);
		return;
	}

	WORD wxSize, wySize;
	fread(&wxSize, sizeof(WORD), 1, fp);
	fread(&wySize, sizeof(WORD), 1, fp);

	printf("collision area size: %d %d", wxSize, wySize);

	for (DWORD x = 0; x < wxSize; ++x)
	{
		for (DWORD y = 0; y < wySize; ++y)
		{
			DWORD dwCount;
			fread(&dwCount, sizeof(DWORD), 1, fp);

			printf("\n%ux%u %u ", x, y, dwCount);

			for (DWORD j = 0; j < dwCount; ++j)
			{
				BYTE bType;
				fread(&bType, sizeof(BYTE), 1, fp);

				switch (bType)
				{
					case COLLISION_TYPE_PLANE:
						printf("P");
						{       
							TPlaneData PlaneData;
							fread(&PlaneData, sizeof(TPlaneData), 1, fp);

							int pairs[6][2] =
							{
								{ 0, 3 },
								{ 0, 1 },
								{ 0, 2 },
								{ 1, 2 },
								{ 1, 3 },
								{ 2, 3 },
							};

							for (int iPairIndex = 0; iPairIndex < 6; iPairIndex++)
							{
								int iFrom = pairs[iPairIndex][0];
								int iTo = pairs[iPairIndex][1];

								if (fabs(PlaneData.v3QuadPosition[iFrom].x - PlaneData.v3QuadPosition[iTo].x) > 100000.0f ||
										fabs(PlaneData.v3QuadPosition[iFrom].y - PlaneData.v3QuadPosition[iTo].y) > 100000.0f)
								{
									sys_log(0, "Blcok too big: %d %d %d %d", 
											iBaseX + (int)  PlaneData.v3QuadPosition[iFrom].x,
											iBaseY + (int) -PlaneData.v3QuadPosition[iFrom].y,
											iBaseX + (int)  PlaneData.v3QuadPosition[iTo].x,
											iBaseY + (int) -PlaneData.v3QuadPosition[iTo].y);
								}
								else
								{
									printf("Block %d %d %d %d\n", 
											iBaseX + (int)  PlaneData.v3QuadPosition[iFrom].x,
											iBaseY + (int) -PlaneData.v3QuadPosition[iFrom].y,
											iBaseX + (int)  PlaneData.v3QuadPosition[iTo].x,
											iBaseY + (int) -PlaneData.v3QuadPosition[iTo].y);


									ProcessLine(
											iBaseX + (int)  PlaneData.v3QuadPosition[iFrom].x,
											iBaseY + (int) -PlaneData.v3QuadPosition[iFrom].y,
											iBaseX + (int)  PlaneData.v3QuadPosition[iTo].x,
											iBaseY + (int) -PlaneData.v3QuadPosition[iTo].y,
											BlockAttribute);

								}
							}
							// 사각형 채우기도 합시다
							// 0 1 2 3 순서대로
							// -- +- -+ ++
							// 근데 y 는 마이너스 취하는거 확인하시길
							// TODO
						}
						break;

//.........这里部分代码省略.........
开发者ID:cCorax2,项目名称:Source_code,代码行数:101,代码来源:test_window.cpp


示例11: MAKEFOURCC

	const DWORD			*m_pdwFourCCList;
	DWORD				m_dwBackBuffers;
	BOOL				m_bShow, m_bLastShow;
	HWND				m_hwnd;
	BOOL m_bOpen; 	
	HANDLE m_cam_hnd;
	BYTE *m_pInputBuff,*m_pOutputBuff;
	POSTINFO m_open_para;
	unsigned char m_uAlpha; //0-0xf
	WIN1SIZE m_sWin1Size;

};

static const DWORD const_dwFourCC[] =
{
	MAKEFOURCC('Y','V','1','2'),
	0
};

CGfxSAMSUNG::CGfxSAMSUNG() : 
	CMcUnknown(0,0)
{
	m_dwWidth = m_dwHeight = 0;
	m_dwBackBuffers = 0;
	m_bShow = m_bLastShow = TRUE;
	ZeroMemory(&m_rectSrc,sizeof(m_rectSrc));
	ZeroMemory(&m_rectDst,sizeof(m_rectDst));
	ZeroMemory(&m_rectScn,sizeof(m_rectScn));
	ZeroMemory(&m_open_para, sizeof(m_open_para));
	ZeroMemory(&m_sWin1Size, sizeof(m_sWin1Size));
	m_hwnd = 0;
开发者ID:xuweiqiang,项目名称:LibVRPresent,代码行数:31,代码来源:GfxSamsung.cpp


示例12: color_rgba

CRenderTarget::CRenderTarget		()
{
	param_blur			= 0.f;
	param_gray			= 0.f;
	param_noise			= 0.f;
	param_duality_h		= 0.f;
	param_duality_v		= 0.f;
	param_noise_fps		= 25.f;
	param_noise_scale	= 1.f;

	im_noise_time		= 1/100;
	im_noise_shift_w	= 0;
	im_noise_shift_h	= 0;

	param_color_base	= color_rgba(127,127,127,	0);
	param_color_gray	= color_rgba(85,85,85,		0);
	param_color_add		= color_rgba(0,0,0,			0);

	dwAccumulatorClearMark			= 0;
	Device.Resources->Evict			();

	// Blenders
	b_occq							= xr_new<CBlender_light_occq>			();
	b_accum_mask					= xr_new<CBlender_accum_direct_mask>	();
	b_accum_direct					= xr_new<CBlender_accum_direct>			();
	b_accum_point					= xr_new<CBlender_accum_point>			();
	b_accum_spot					= xr_new<CBlender_accum_spot>			();
	b_accum_reflected				= xr_new<CBlender_accum_reflected>		();
	b_bloom							= xr_new<CBlender_bloom_build>			();
	b_luminance						= xr_new<CBlender_luminance>			();
	b_combine						= xr_new<CBlender_combine>				();

	//	NORMAL
	{
		u32		w=Device.dwWidth, h=Device.dwHeight;
		rt_Position.create			(r2_RT_P,		w,h,D3DFMT_A16B16G16R16F);
		rt_Normal.create			(r2_RT_N,		w,h,D3DFMT_A16B16G16R16F);

		// select albedo & accum
		if (RImplementation.o.mrtmixdepth)	
		{
			// NV50
			rt_Color.create			(r2_RT_albedo,	w,h,D3DFMT_A8R8G8B8		);
			rt_Accumulator.create	(r2_RT_accum,	w,h,D3DFMT_A16B16G16R16F);
		}
		else		
		{
			// can't - mix-depth
			if (RImplementation.o.fp16_blend) {
				// NV40
				rt_Color.create				(r2_RT_albedo,		w,h,D3DFMT_A16B16G16R16F);	// expand to full
				rt_Accumulator.create		(r2_RT_accum,		w,h,D3DFMT_A16B16G16R16F);
			} else {
				// R4xx, no-fp-blend,-> albedo_wo
				VERIFY						(RImplementation.o.albedo_wo);
				rt_Color.create				(r2_RT_albedo,		w,h,D3DFMT_A8R8G8B8		);	// normal
				rt_Accumulator.create		(r2_RT_accum,		w,h,D3DFMT_A16B16G16R16F);
				rt_Accumulator_temp.create	(r2_RT_accum_temp,	w,h,D3DFMT_A16B16G16R16F);
			}
		}

		// generic(LDR) RTs
		rt_Generic_0.create			(r2_RT_generic0,w,h,D3DFMT_A8R8G8B8		);
		rt_Generic_1.create			(r2_RT_generic1,w,h,D3DFMT_A8R8G8B8		);
	}

	// OCCLUSION
	s_occq.create					(b_occq,		"r2\\occq");

	// DIRECT (spot)
	D3DFORMAT						depth_format	= (D3DFORMAT)RImplementation.o.HW_smap_FORMAT;

	if (RImplementation.o.HW_smap)
	{
		D3DFORMAT	nullrt				= D3DFMT_R5G6B5;
		if (RImplementation.o.nullrt)	nullrt	= (D3DFORMAT)MAKEFOURCC('N','U','L','L');

		u32	size					=RImplementation.o.smapsize	;
		rt_smap_depth.create		(r2_RT_smap_depth,			size,size,depth_format	);
		rt_smap_surf.create			(r2_RT_smap_surf,			size,size,nullrt		);
		rt_smap_ZB					= NULL;
		s_accum_mask.create			(b_accum_mask,				"r2\\accum_mask");
		s_accum_direct.create		(b_accum_direct,			"r2\\accum_direct");
	}
	else
	{
		u32	size					=RImplementation.o.smapsize	;
		rt_smap_surf.create			(r2_RT_smap_surf,			size,size,D3DFMT_R32F);
		rt_smap_depth				= NULL;
		R_CHK						(HW.pDevice->CreateDepthStencilSurface	(size,size,D3DFMT_D24X8,D3DMULTISAMPLE_NONE,0,TRUE,&rt_smap_ZB,NULL));
		s_accum_mask.create			(b_accum_mask,				"r2\\accum_mask");
		s_accum_direct.create		(b_accum_direct,			"r2\\accum_direct");
	}

	// POINT
	{
		s_accum_point.create		(b_accum_point,				"r2\\accum_point_s");
		accum_point_geom_create		();
		g_accum_point.create		(D3DFVF_XYZ,				g_accum_point_vb, g_accum_point_ib);
		accum_omnip_geom_create		();
//.........这里部分代码省略.........
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:101,代码来源:r2_rendertarget.cpp


示例13: memset

IplImage* CvCaptureCAM_VFW::retrieveFrame(int)
{
    BITMAPINFO vfmt;
    memset( &vfmt, 0, sizeof(vfmt));
    BITMAPINFOHEADER& vfmt0 = vfmt.bmiHeader;

    if( !capWnd )
        return 0;

    const DWORD sz = capGetVideoFormat( capWnd, &vfmt, sizeof(vfmt));
    const int prevWidth = frame ? frame->width : 0;
    const int prevHeight = frame ? frame->height : 0;

    if( !hdr || hdr->lpData == 0 || sz == 0 )
        return 0;

    if( !frame || frame->width != vfmt0.biWidth || frame->height != vfmt0.biHeight )
    {
        cvReleaseImage( &frame );
        frame = cvCreateImage( cvSize( vfmt0.biWidth, vfmt0.biHeight ), 8, 3 );
    }

    if( vfmt0.biCompression != BI_RGB ||
        vfmt0.biBitCount != 24 )
    {
        BITMAPINFOHEADER vfmt1 = icvBitmapHeader( vfmt0.biWidth, vfmt0.biHeight, 24 );

        if( hic == 0 || fourcc != vfmt0.biCompression ||
            prevWidth != vfmt0.biWidth || prevHeight != vfmt0.biHeight )
        {
            closeHIC();
            hic = ICOpen( MAKEFOURCC('V','I','D','C'),
                          vfmt0.biCompression, ICMODE_DECOMPRESS );
            if( hic )
            {
                if( ICDecompressBegin( hic, &vfmt0, &vfmt1 ) != ICERR_OK )
                {
                    closeHIC();
                    return 0;
                }
            }
        }

        if( !hic || ICDecompress( hic, 0, &vfmt0, hdr->lpData,
            &vfmt1, frame->imageData ) != ICERR_OK )
        {
            closeHIC();
            return 0;
        }

        cvFlip( frame, frame, 0 );
    }
    else
    {
        IplImage src;
        cvInitImageHeader( &src, cvSize(vfmt0.biWidth, vfmt0.biHeight),
            IPL_DEPTH_8U, 3, IPL_ORIGIN_BL, 4 );
        cvSetData( &src, hdr->lpData, src.widthStep );
        cvFlip( &src, frame, 0 );
    }

    return frame;
}
开发者ID:qqchen,项目名称:opencv2410-VS,代码行数:63,代码来源:cap_vfw.cpp


示例14: if

void CRT::create	(LPCSTR Name, u32 w, u32 h,	D3DFORMAT f)
{
	if (pSurface)	return;

	R_ASSERT	(HW.pDevice && Name && Name[0] && w && h);
	_order		= CPU::GetCLK()	;	//Device.GetTimerGlobal()->GetElapsed_clk();

	HRESULT		_hr;

	dwWidth		= w;
	dwHeight	= h;
	fmt			= f;

	// Get caps
	D3DCAPS9	caps;
	R_CHK		(HW.pDevice->GetDeviceCaps(&caps));

	// Pow2
	if (!btwIsPow2(w) || !btwIsPow2(h))
	{
		if (!HW.Caps.raster.bNonPow2)	return;
	}

	// Check width-and-height of render target surface
	if (w>caps.MaxTextureWidth)			return;
	if (h>caps.MaxTextureHeight)		return;

	// Select usage
	u32 usage	= 0;
	if (D3DFMT_D24X8==fmt)									usage = D3DUSAGE_DEPTHSTENCIL;
	else if (D3DFMT_D24S8		==fmt)						usage = D3DUSAGE_DEPTHSTENCIL;
	else if (D3DFMT_D15S1		==fmt)						usage = D3DUSAGE_DEPTHSTENCIL;
	else if (D3DFMT_D16			==fmt)						usage = D3DUSAGE_DEPTHSTENCIL;
	else if (D3DFMT_D16_LOCKABLE==fmt)						usage = D3DUSAGE_DEPTHSTENCIL;
	else if ((D3DFORMAT)MAKEFOURCC('D','F','2','4') == fmt)	usage = D3DUSAGE_DEPTHSTENCIL;
	else													usage = D3DUSAGE_RENDERTARGET;

	// Validate render-target usage
	_hr = HW.pD3D->CheckDeviceFormat(
		HW.DevAdapter,
		HW.DevT,
		HW.Caps.fTarget,
		usage,
		D3DRTYPE_TEXTURE,
		f
		);
	if (FAILED(_hr))					return;

	// Try to create texture/surface
	Device.Resources->Evict				();
	_hr = HW.pDevice->CreateTexture		(w, h, 1, usage, f, D3DPOOL_DEFAULT, &pSurface,NULL);
	if (FAILED(_hr) || (0==pSurface))	return;

	// OK
#ifdef DEBUG
	Msg			("* created RT(%s), %dx%d",Name,w,h);
#endif // DEBUG
	R_CHK		(pSurface->GetSurfaceLevel	(0,&pRT));
	pTexture	= Device.Resources->_CreateTexture	(Name);
	pTexture->surface_set	(pSurface);
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:61,代码来源:SH_RT.cpp


示例15: v4w_open_videodevice

static int v4w_open_videodevice(V4wState *s, int format, MSVideoSize *vsize)
{
	// Initialize COM
	CoInitialize(NULL);

	// get a Graph
	HRESULT hr=s->m_pGraph.CoCreateInstance(CLSID_FilterGraph);
	if(FAILED(hr))
	{
		return -1;
	}

	// get a CaptureGraphBuilder2
#if !defined(_WIN32_WCE)
	hr=s->m_pBuilder.CoCreateInstance(CLSID_CaptureGraphBuilder2);
#else
	hr=s->m_pBuilder.CoCreateInstance(CLSID_CaptureGraphBuilder);
#endif
	if(FAILED(hr))
	{
		return -2;
	}

	// connect capture graph builder with the graph
	s->m_pBuilder->SetFiltergraph(s->m_pGraph);

	// get mediacontrol so we can start and stop the filter graph
	hr=s->m_pGraph.QueryInterface(&(s->m_pControl));
	if(FAILED(hr))
	{
		return -3;
	}

	// get DXFilter
	s->m_pDXFilter = new CDXFilter(NULL, &hr, FALSE);
	if(s->m_pDXFilter==NULL)
	{
		return -4;
	}
	s->m_pDXFilter->AddRef();
	if(FAILED(hr))
	{
		return -4;
	}

	CMediaType mt;
	mt.SetType(&MEDIATYPE_Video);

	if (format==MS_YUV420P)
	{
		GUID m = (GUID)FOURCCMap(MAKEFOURCC('I','4','2','0'));
		mt.SetSubtype(&m);
		mt.SetSubtype(&MEDIASUBTYPE_YV12);
	}
	else //if (format==MS_RGB24)
	{
		mt.SetSubtype(&MEDIASUBTYPE_RGB24);
	}

	//mt.SetSubtype(&MEDIASUBTYPE_IYUV);
	//mt.SetSubtype(&MEDIASUBTYPE_YUYV);
	//mt.SetSubtype(&MEDIASUBTYPE_RGB24);
	//mt.SetSampleSize();
	mt.formattype = FORMAT_VideoInfo;
	mt.SetTemporalCompression(FALSE);

	VIDEOINFO *pvi = (VIDEOINFO *)
	mt.AllocFormatBuffer(sizeof(VIDEOINFO));
	if (NULL == pvi)
		return E_OUTOFMEMORY;
	ZeroMemory(pvi, sizeof(VIDEOINFO));
	if (format==MS_YUV420P)
	{
		pvi->bmiHeader.biCompression = MAKEFOURCC('I','4','2','0');
		pvi->bmiHeader.biCompression = MAKEFOURCC('Y','V','1','2');
		pvi->bmiHeader.biBitCount = 12;
	}
	else
	{
		pvi->bmiHeader.biCompression = BI_RGB;
		pvi->bmiHeader.biBitCount = 24;
	}
	pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
	pvi->bmiHeader.biWidth = vsize->width;
	pvi->bmiHeader.biHeight = vsize->height;
	pvi->bmiHeader.biPlanes = 1;
	pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader);
	pvi->bmiHeader.biClrImportant = 0;
	mt.SetSampleSize(pvi->bmiHeader.biSizeImage);
	mt.SetFormat((BYTE*)pvi, sizeof(VIDEOINFO));

	hr = s->m_pDXFilter->SetAcceptedMediaType(&mt);
	if(FAILED(hr))
	{
		return -5;
	}

	hr = s->m_pDXFilter->SetCallback(Callback); 
	if(FAILED(hr))
	{
//.........这里部分代码省略.........
开发者ID:hunghtbk,项目名称:LinphoneV1,代码行数:101,代码来源:wincevideods.c


示例16: if

//--------------------------------------------------------------------------------------------------------------
SVS*	CResourceManager::_CreateVS		(LPCSTR _name)
{
	string_path			name;
	strcpy_s				(name,_name);
	if (0 == ::Render->m_skinning)	strcat(name,"_0");
	if (1 == ::Render->m_skinning)	strcat(name,"_1");
	if (2 == ::Render->m_skinning)	strcat(name,"_2");
	LPSTR N				= LPSTR		(name);
	map_VS::iterator I	= m_vs.find	(N);
	if (I!=m_vs.end())	return I->second;
	else
	{
		SVS*	_vs					= xr_new<SVS>	();
		_vs->dwFlags				|= xr_resource_flagged::RF_REGISTERED;
		m_vs.insert					(mk_pair(_vs->set_name(name),_vs));
		if (0==stricmp(_name,"null"))	{
			_vs->vs				= NULL;
			return _vs;
		}

		includer					Includer;
		LPD3DXBUFFER				pShaderBuf	= NULL;
		LPD3DXBUFFER				pErrorBuf	= NULL;
		LPD3DXSHADER_CONSTANTTABLE	pConstants	= NULL;
		HRESULT						_hr			= S_OK;
		string_path					cname;
		strconcat					(sizeof(cname),cname,::Render->getShaderPath(),_name,".vs");
		FS.update_path				(cname,	"$game_shaders$", cname);
//		LPCSTR						target		= NULL;

		IReader*					fs			= FS.r_open(cname);
		R_ASSERT3					(fs, "shader file doesnt exist", cname);

		// Select target
		LPCSTR						c_target	= "vs_2_0";
		LPCSTR						c_entry		= "main";
		/*if (HW.Caps.geometry.dwVersion>=CAP_VERSION(3,0))			target="vs_3_0";
		else*/ if (HW.Caps.geometry_major>=2)						c_target="vs_2_0";
		else 														c_target="vs_1_1";

		LPSTR pfs					= xr_alloc<char>(fs->length() + 1);
		strncpy						(pfs, (LPCSTR)fs->pointer(), fs->length());
		pfs							[fs->length()] = 0;

		if (strstr(pfs, "main_vs_1_1"))			{ c_target = "vs_1_1"; c_entry = "main_vs_1_1";	}
		if (strstr(pfs, "main_vs_2_0"))			{ c_target = "vs_2_0"; c_entry = "main_vs_2_0";	}
		
		xr_free(pfs);

		// vertex
		R_ASSERT2					(fs,cname);
		_hr = ::Render->shader_compile(name,LPCSTR(fs->pointer()),fs->length(), NULL, &Includer, c_entry, c_target, D3DXSHADER_DEBUG | D3DXSHADER_PACKMATRIX_ROWMAJOR /*| D3DXSHADER_PREFER_FLOW_CONTROL*/, &pShaderBuf, &pErrorBuf, NULL);
//		_hr = D3DXCompileShader		(LPCSTR(fs->pointer()),fs->length(), NULL, &Includer, "main", target, D3DXSHADER_DEBUG | D3DXSHADER_PACKMATRIX_ROWMAJOR, &pShaderBuf, &pErrorBuf, NULL);
		FS.r_close					(fs);

		if (SUCCEEDED(_hr))
		{
			if (pShaderBuf)
			{
				_hr = HW.pDevice->CreateVertexShader	((DWORD*)pShaderBuf->GetBufferPointer(), &_vs->vs);
				if (SUCCEEDED(_hr))	{
					LPCVOID			data		= NULL;
					_hr	= D3DXFindShaderComment	((DWORD*)pShaderBuf->GetBufferPointer(),MAKEFOURCC('C','T','A','B'),&data,NULL);
					if (SUCCEEDED(_hr) && data)
					{
						pConstants				= LPD3DXSHADER_CONSTANTTABLE(data);
						_vs->constants.parse	(pConstants,0x2);
					} else	_hr = E_FAIL;
				}
			}
			else	_hr = E_FAIL;
		} else {
			VERIFY	(pErrorBuf);
			Log		("! error: ",(LPCSTR)pErrorBuf->GetBufferPointer());
		}
		_RELEASE	(pShaderBuf);
		_RELEASE	(pErrorBuf);
		pConstants	= NULL;
		R_CHK		(_hr);
		return		_vs;
	}
}
开发者ID:Karlan88,项目名称:xray,代码行数:83,代码来源:ResourceManager_Resources.cpp


示例17: MS_GUID

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MAKEHASH函数代码示例发布时间:2022-05-30
下一篇:
C++ MAGNUM_VERIFY_NO_ERROR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap