本文整理汇总了C++中LPDIRECTDRAWSURFACE::SetSurfaceDesc方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTDRAWSURFACE::SetSurfaceDesc方法的具体用法?C++ LPDIRECTDRAWSURFACE::SetSurfaceDesc怎么用?C++ LPDIRECTDRAWSURFACE::SetSurfaceDesc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTDRAWSURFACE
的用法示例。
在下文中一共展示了LPDIRECTDRAWSURFACE::SetSurfaceDesc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitFail
//.........这里部分代码省略.........
if ( hRet != DD_OK ) {
SetDDerror("DirectDraw2::CreateSurface", hRet);
goto error_end;
}
hRet = g_pDDSBack->QueryInterface(
&IID_IDirectDrawSurface3, (LPVOID *)&g_pDDSOne);
g_pDDSBack->Release();
if ( hRet != DD_OK ) {
SetDDerror("DirectDrawSurface::QueryInterface", hRet);
goto error_end;
}
#endif
}
#if 0
if ( (flag & SDL_HWSURFACE) == SDL_HWSURFACE ) {
/* Check to see whether the surface actually ended up
in video memory, and fail if not. We expect the
surfaces we create here to actually be in hardware!
*/
hRet = g_pDDSOne->GetCaps(&ddsd.ddsCaps);
if ( hRet != DD_OK ) {
//SetDDerror("DirectDrawSurface3::GetCaps", hRet);
goto error_end;
}
if ( (ddsd.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) !=
DDSCAPS_VIDEOMEMORY ) {
//SDL_SetError("No room in video memory");
goto error_end;
}
} else {
/* Try to hook our surface memory */
ddsd.dwFlags = DDSD_LPSURFACE;
ddsd.lpSurface = pixelData;//surface->pixels;
hRet = g_pDDSOne->SetSurfaceDesc(
&ddsd, 0);
if ( hRet != DD_OK ) {
//SetDDerror("DirectDraw2::SetSurfaceDesc", hRet);
goto error_end;
}
}
/* Make sure the surface format was set properly */
SDL_memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
hRet = IDirectDrawSurface3_Lock(g_pDDSOne, NULL,
&ddsd, (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
if ( hRet != DD_OK ) {
//SetDDerror("DirectDrawSurface3::Lock", hRet);
goto error_end;
}
IDirectDrawSurface3_Unlock(g_pDDSOne, NULL);
if ( (flag & SDL_HWSURFACE) == SDL_SWSURFACE ) {
if ( ddsd.lpSurface != surface->pixels ) {
//SDL_SetError("DDraw didn't use SDL surface memory");
goto error_end;
}
if (
#if defined(NONAMELESSUNION)
ddsd.u1.lPitch
#else
ddsd.lPitch
#endif
!= (LONG)surface->pitch ) {
//SDL_SetError("DDraw created surface with wrong pitch");