请教下熟悉HGE的朋友

我看你有戏 2015-09-21 02:22:12
这是我用vc6写的简单的代码,有个问题,为啥我鼠标移到窗口上去,鼠标不见了,这是啥问题?


// HGE_01.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "../include/hge.h"

#pragma comment (lib, "../lib/vc/hge.LIB")
//#pragma comment (lib, "../lib/vc/hgehelp.LIB")

HGE *hge = 0;
bool FrameFunc()
{
if(hge->Input_GetKeyState(HGEK_ESCAPE))
return true;


return false;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
hge = hgeCreate(HGE_VERSION);
hge->System_SetState(HGE_FRAMEFUNC,FrameFunc);
hge->System_SetState(HGE_WINDOWED,true);
hge->System_SetState(HGE_USESOUND,false);
hge->System_SetState(HGE_TITLE,"HGE 01 ");

if(hge->System_Initiate())
{
hge->System_Start();
}
else
{
MessageBox(NULL,hge->System_GetErrorMessage(),"Error",MB_OK|MB_ICONERROR|MB_APPLMODAL);
}

hge->System_Shutdown();
hge->Release();

return 0;
}




...全文
97 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
宋寒松 2015-09-21
  • 打赏
  • 举报
回复
HGE默认是需要自己渲染鼠标位图,你需要自己绘制鼠标指针,或者另外初始化用系统鼠标指针。
引用 楼主 henry3695 的回复:
这是我用vc6写的简单的代码,有个问题,为啥我鼠标移到窗口上去,鼠标不见了,这是啥问题?

// HGE_01.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "../include/hge.h"

#pragma comment (lib, "../lib/vc/hge.LIB")
//#pragma comment (lib, "../lib/vc/hgehelp.LIB")

HGE *hge = 0;
bool FrameFunc()
{
	if(hge->Input_GetKeyState(HGEK_ESCAPE))
		return true;

	
	return false;
}
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	hge = hgeCreate(HGE_VERSION);
	hge->System_SetState(HGE_FRAMEFUNC,FrameFunc);
	hge->System_SetState(HGE_WINDOWED,true);
	hge->System_SetState(HGE_USESOUND,false);
	hge->System_SetState(HGE_TITLE,"HGE 01 ");

	if(hge->System_Initiate())
	{
		hge->System_Start();
	}
	else
	{
		MessageBox(NULL,hge->System_GetErrorMessage(),"Error",MB_OK|MB_ICONERROR|MB_APPLMODAL);
	}

	hge->System_Shutdown();
	hge->Release();

	return 0;
}




赵4老师 2015-09-21
  • 打赏
  • 举报
回复
如果HGE是开源的,单步进去观察创建窗口相关API有关鼠标指针的参数。
赵4老师 2015-09-21
  • 打赏
  • 举报
回复
我不熟悉。

64,637

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧