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


C++ LPDIRECTDRAWPALETTE::Release方法代码示例

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


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

示例1: Game_Shutdown

int Game_Shutdown(void *parms = NULL, int num_parms = 0)
{
// this is called after the game is exited and the main event
// loop while is exited, do all you cleanup and shutdown here

// kill all the surfaces


// first the palette
if (lpddpal)
   {
   lpddpal->Release();
   lpddpal = NULL;
   } // end if

// now the primary surface
if (lpddsprimary)
   {
   lpddsprimary->Release();
   lpddsprimary = NULL;
   } // end if

// now blow away the IDirectDraw4 interface
if (lpdd)
   {
   lpdd->Release();
   lpdd = NULL;
   } // end if

// return success or failure or your own return code here
return(1);

} // end Game_Shutdown
开发者ID:calyx,项目名称:windows-game-source-code,代码行数:33,代码来源:demo7_14.cpp

示例2: DD_Shutdown

int DD_Shutdown(void)
{
// this function release all the resources directdraw
// allocated, mainly to com objects

// release the clipper first
if (lpddclipper)
    lpddclipper->Release();

// release the palette
if (lpddpal)
   lpddpal->Release();

// release the secondary surface
if (lpddsback)
    lpddsback->Release();

// release the primary surface
if (lpddsprimary)
   lpddsprimary->Release();

// finally, the main dd object
if (lpdd)
    lpdd->Release();

// return success
return(1);
} // end DD_Shutdown
开发者ID:calyx,项目名称:windows-game-source-code,代码行数:28,代码来源:blackbox.cpp

示例3: CleanupGraphics

//-----------------------------------------------------------------------------
// Name: CleanupGraphics()
// Desc:
//-----------------------------------------------------------------------------
VOID CleanupGraphics()
{
    for( DWORD i=0; i<4; i++ )
        if( g_pddsShip[i] )
            g_pddsShip[i]->Release();
    if( g_pddsNumbers )
        g_pddsNumbers->Release();
    if( g_pddsFrontBuffer )
        g_pddsFrontBuffer->Release();
    if( g_pArtPalette )
        g_pArtPalette->Release();
    if( g_pSplashPalette )
        g_pSplashPalette->Release();
    if( !g_bFullscreen && g_pddsBackBuffer )
        g_pddsBackBuffer->Release();
    if( g_pDD )
        g_pDD->Release();
}
开发者ID:grakidov,项目名称:Render3D,代码行数:22,代码来源:gfx.cpp

示例4: Game_Shutdown

int Game_Shutdown(void *parms = NULL, int num_parms = 0)
{
// this is called after the game is exited and the main event
// loop while is exited, do all you cleanup and shutdown here


// first the palette
if (lpddpal)
   {
   lpddpal->Release();
   lpddpal = NULL;
   } // end if


// now the lpddsbackground surface
if (lpddsbackground)
   {
   lpddsbackground->Release();
   lpddsbackground = NULL;
   } // end if

// now the lpddsback surface
if (lpddsback)
   {
   lpddsback->Release();
   lpddsback = NULL;
   } // end if


// now the primary surface
if (lpddsprimary)
   {
   lpddsprimary->Release();
   lpddsprimary = NULL;
   } // end if

// now blow away the IDirectDraw4 interface
if (lpdd)
   {
   lpdd->Release();
   lpdd = NULL;
   } // end if

// unload the bitmap file, we no longer need it
Unload_Bitmap_File(&bitmap);

// return success or failure or your own return code here
return(1);

} // end Game_Shutdown
开发者ID:klobodnf,项目名称:my_game,代码行数:50,代码来源:demo7_12.cpp

示例5:

int	PisteDraw_Lopeta()
{

	if (!PD_unload) {

		int i;

		for (i=0; i<MAX_FONTTEJA; i++)
		{
			if (PD_fontit[i] != NULL )
				delete PD_fontit[i];
			PD_fontit[i] = NULL;
		}

		for (i=2;i<MAX_BUFFEREITA;i++)		// 0 ja 1 on varattu taustapuskureille
			PisteDraw_Buffer_Tuhoa(i);

		if (PD_lpddpal)
		{
			PD_lpddpal->Release();
		}

		PisteDraw_Buffer_Tuhoa(PD_TAUSTABUFFER);

		PisteDraw_Buffer_Tuhoa(PD_TAUSTABUFFER2);

		if (PD_lpddsprimary)
		{
			PD_lpddsprimary->Release();
		} 

		if (PD_lpdd)
		{
			PD_lpdd->Release();
		}

		PD_unload = true;
	}

	return 0;
}
开发者ID:piotrulos,项目名称:PK2remakes,代码行数:41,代码来源:PisteDraw.cpp

示例6: DefWindowProc


//.........这里部分代码省略.........
						// screen type.
						DWORD dwWritten;
					   /* Targa File Header : (Little Endian / Intel)
						* Offset Length  Description
						*      0      1  ID field length
						*      1      1  Color map type.
						*      2      1  Image type.
						*      3      2  First color map entry.
						*      5      2  Color map length.
						*      7      1  Color map entry size.
						*      8      2  Image X origin.
						*     10      2  Image Y Origin.
						*     12      2  Image Width.
						*     14      2  Image Height.
						*     16      1  Bits per pixel.
						*     17      1  Image descriptor bits.
						* (from : "Graphics File Formats", David C. Kay and John R. Levine)
						*/
#						define OutB(b)\
						{	unsigned char b2;\
							b2 = b;\
							WriteFile(hFile, &b2, sizeof(b2), &dwWritten, NULL);\
						}
#						define OutW(w)\
						{	unsigned short w2;\
							w2 = w;\
							WriteFile(hFile, &w2, sizeof(w2), &dwWritten, NULL);\
						}
						OutB(0);		// No message ID field length.
						OutB(0);		// Colormap type = 0; true color.
						OutB(2);		// Image type = 2, True color, uncompressed.
						OutW(0);		// First colormap entry is 0, (Because Cmap type = 0).
						OutW(0);		// Colormap length = 0, (CMap type = 0).
						OutB(0);		// CMap entry size is 0 (because CMap type = 0)
						OutW(0);		// OriginX = 0;
						OutW(0);		// OriginY = 0;
						OutW(XRES);		// Image Width is the value of the XRES constant.
						OutW(YRES);		// Image Height is the value of the YRES constant.
						OutB(24);		// Bits per pixel.
						OutB(0x20);		// Image Descriptor Bits (0x20 = left to right, top to bottom).

						// Each pixel is written as a Blue Green Red triple.

						// Lock the surface & write each byte.
						DDSURFACEDESC ddsd;
						memset(&ddsd, 0, sizeof(DDSURFACEDESC));
						ddsd.dwSize = sizeof(ddsd);
						ddreturn = lpBackbuffer->Lock(NULL, &ddsd, DDLOCK_READONLY | DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, NULL);
						if (ddreturn == DD_OK)
						{
							//DrawWorld((unsigned char *)ddsd.lpSurface, (int)ddsd.lPitch);
							int nX, nY;
							for (nY = 0; nY < YRES; nY++)
							{
								for (nX = 0; nX < XRES; nX++)
								{
									unsigned char ucByte;
									ucByte = *(((unsigned char *)ddsd.lpSurface) + ddsd.lPitch * nY + nX);

									// Index the colormap & write the BGR triple.
									OutB(WinColormap[ucByte].peBlue);
									OutB(WinColormap[ucByte].peGreen);
									OutB(WinColormap[ucByte].peRed);
								}
							}
							lpBackbuffer->Unlock(NULL);
						}
						// Close the file, we're done...
						CloseHandle(hFile);
					}
			}
			break;

		case WM_DESTROY :
			if (lpDirectDrawObject != NULL)
			{
				if (lpBackbuffer != NULL)
					lpBackbuffer->Release();
				if (lpPrimary != NULL)
					lpPrimary->Release();
				if (lpPalette != NULL)
					lpPalette->Release();
				lpDirectDrawObject->Release();
			}
			/* Free the world. */
			EndWorld();

			/* Free the font. */
			if (AppFont != NULL)
				DeleteObject(AppFont);

			ShowCursor(TRUE);
			PostQuitMessage(0);
			break;
		default:
			return DefWindowProc(hwnd, message, wParam, lParam);
	}

	return 0L;
}
开发者ID:kingletbv,项目名称:chrome2k,代码行数:101,代码来源:dxmain.cpp


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