Beispiel #1
0
static int InitializeDDraw(int fs)
{
	//only init the palette the first time through
	if(firstInitialize) {
		firstInitialize = false;
    color_palette = (PALETTEENTRY*)malloc(256 * sizeof(PALETTEENTRY));
	}

	//(disvaccel&(1<<(fs?1:0)))?(GUID FAR *)DDCREATE_EMULATIONONLY:
	ddrval = DirectDrawCreate((disvaccel&(1<<(fs?1:0)))?(GUID FAR *)DDCREATE_EMULATIONONLY:NULL, &lpDD, NULL);
	if (ddrval != DD_OK)
	{
		ShowDDErr("Error creating DirectDraw object.");
		return 0;
	}

	//mbg merge 7/17/06 changed:
	ddrval = IDirectDraw_QueryInterface(lpDD,IID_IDirectDraw7,(LPVOID *)&lpDD7);
	//ddrval = IDirectDraw_QueryInterface(lpDD,&IID_IDirectDraw7,(LPVOID *)&lpDD7);
	IDirectDraw_Release(lpDD);

	if (ddrval != DD_OK)
	{
		ShowDDErr("Error querying interface.");
		return 0;
	}

	caps.dwSize=sizeof(caps);
	if(IDirectDraw7_GetCaps(lpDD7,&caps,0)!=DD_OK)
	{
		ShowDDErr("Error getting capabilities.");
		return 0;
	}
	return 1;
}
Beispiel #2
0
static int ddraw_verify_caps(dd_info *dd)
{
	int retval = 0;
	HRESULT result;

	// get the capabilities
	dd->ddcaps.dwSize = sizeof(dd->ddcaps);
	dd->helcaps.dwSize = sizeof(dd->helcaps);
	result = IDirectDraw7_GetCaps(dd->ddraw, &dd->ddcaps, &dd->helcaps);
	if (result != DD_OK)
	{
		mame_printf_verbose("DirectDraw: Error %08X during IDirectDraw7_GetCaps call\n", (int)result);
		return 1;
	}

	// determine if hardware stretching is available
	if ((dd->ddcaps.dwCaps & DDCAPS_BLTSTRETCH) == 0)
	{
		mame_printf_verbose("DirectDraw: Warning - Device does not support hardware stretching\n");
		retval = 1;
	}

	return retval;
}
Beispiel #3
0
static HRESULT WINAPI
IDirectDraw4Impl_GetCaps(LPDIRECTDRAW4 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
{
    return IDirectDraw7_GetCaps((IDirectDraw7 *)ddraw_from_ddraw4(This), pDDC1, pDDC2);
}