core_interface.cpp

来自「旋转图像Demo和其源代码」· C++ 代码 · 共 45 行

CPP
45
字号
/**************************************************
DirectDraw接口模块
Author:  LittleFish     QQ:93663886 
E-Mail:  kittyfish_1981@yahoo.com.cn
Blog:    http://blog.csdn.net/kittyfish
真诚的期待你提出改良方法或程序BUG
**************************************************/

#include "Core_Interface.h"


BOOL CreateApplication( int x, int y, int width, int height, HINSTANCE hInst, TCHAR* chCaption )
{
	cApplication* pApp = new cApplication();
	pApp->SetHinstance( hInst );
	pApp->SetPos( x, y );
	pApp->SetSize( width, height );
	pApp->SetCaption( chCaption );
	g_pApplication = pApp;
	if( g_pApplication == NULL )
		return FALSE;
	if( !pApp->Run() )
	{
		DebugMB( _T("Failed to CreateApplication !!!") );
	}
	return TRUE;
}

cDirectDraw* CreateDirectDraw( BOOL bFullScreen/* =FALSE */, int iWidth/* =800 */, int iHeight/* =600  */)
{
	if( g_pDirectDraw != NULL )
		return g_pDirectDraw;
	if( g_pApplication == NULL )
	{
		DebugMB( _T("CreateApplication before CreateDirectDraw !!!") );
		return NULL;
	}
	g_pDirectDraw = new cDirectDraw();
	if( !g_pDirectDraw->Create( g_pApplication->GethWnd(), g_pApplication->GethInst(), bFullScreen, iWidth, iHeight ) )
	{
		DebugMB( _T("Failed to CreateDirectDraw !!!") );
		return NULL;
	}
	return g_pDirectDraw;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?