⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cwindow.cpp

📁 成熟的RPG引擎,Flysky发布. 斜视角引擎.
💻 CPP
字号:
#include "../GameH.h"
#include <math.h>
BOOL CreateGWindow(HINSTANCE hInstance,HWND &hwnd,int nCmdShow)
{
	WNDCLASSEX wndclass;
	wndclass.cbClsExtra=0;
	wndclass.cbWndExtra=0;
	wndclass.hbrBackground=NULL;
	wndclass.hCursor=NULL;
	wndclass.hIcon=LoadIcon(hInstance,(LPCTSTR)IDI_GameIco);
	wndclass.hInstance=hInstance;
	wndclass.lpfnWndProc=(WNDPROC)WinProc;
	wndclass.lpszClassName="ShuiJing_Mh";
	wndclass.lpszMenuName=NULL;
	wndclass.style=NULL;
	wndclass.hIconSm=NULL;
	wndclass.cbSize=sizeof(WNDCLASSEX);
	RegisterClassEx(&wndclass);
	char gamename[MAX_LOADSTRING];
	LoadString(hInstance,104,gamename,MAX_LOADSTRING);
	hwnd=CreateWindow("ShuiJing_Mh",gamename,WS_POPUP | WS_OVERLAPPEDWINDOW,0,0,ScreenWidth,ScreenHeight,NULL,NULL,hInstance,NULL); //创建窗口
    //WS_OVERLAPPEDWINDOW| | WS_MAXIMIZE
	ShowWindow(hwnd,nCmdShow);//显示窗口
    UpdateWindow(hwnd);//更新窗口
	return true;

}
//显示鼠标
//图片要自己读取到SS
//提升速度
void PrintMouse(LPDIRECTDRAWSURFACE7 SS,LPDIRECTDRAWSURFACE7 DS)
{
	RECT rect={0,0,CH,CW};
    GetCursorPos(&curpos);
	if (IsMouse==true)
	{
	BltFast(SS,curpos.x,curpos.y,DS,&rect,SrcKey);
	}
}	
double AngleMouse(int dx,int dy,int sx,int sy) //原读数,就是中心点,现在读数就是鼠标位置
{
		double tx=sx-dx;
		double ty=sy-dy;
		return atan((ty/tx));
}

⌨️ 快捷键说明

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