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


C++ LPDIRECTDRAW7::GetAvailableVidMem方法代码示例

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


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

示例1: Test_GetAvailableVidMem

BOOL Test_GetAvailableVidMem (INT* passed, INT* failed)
{
	LPDIRECTDRAW7 DirectDraw;

	/* Preparations */
	if (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) != DD_OK)
	{
		printf("ERROR: Failed to set up ddraw\n");
		return FALSE;
	}

	/* Here we go */
	DWORD Total, Free;
	DDSCAPS2 Caps = { 0 };

	TEST (DirectDraw->GetAvailableVidMem(&Caps, NULL, NULL) == DDERR_INVALIDPARAMS);
	TEST (DirectDraw->GetAvailableVidMem(NULL, &Total, &Free) == DDERR_INVALIDPARAMS);
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK);

    /* testing caps */
	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_RESERVED1;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_ALPHA;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_BACKBUFFER;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDPARAMS );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_COMPLEX;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDPARAMS );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_FLIP;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDPARAMS );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_FRONTBUFFER;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDPARAMS );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_OVERLAY;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_PALETTE;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDPARAMS );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_PRIMARYSURFACE;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_RESERVED3;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_SYSTEMMEMORY;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDPARAMS );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_TEXTURE;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_3DDEVICE;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_VIDEOMEMORY;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_VISIBLE;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDPARAMS );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_WRITEONLY;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDPARAMS );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_ZBUFFER;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_OWNDC;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDPARAMS );

	memset(&Caps,0,sizeof(DDSCAPS2));
	Caps.dwCaps = DDSCAPS_LIVEVIDEO;
	TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK );

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


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