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

📄 emgui-test.c

📁 嵌入式图形处理系统,emgui嵌入式图形处理系统,
💻 C
字号:
#include "emGUI.h"
#include "lcd.h"

void start()
{
	clrbss();
	boot_card();
}

static unsigned32 appCount;

static unsigned32 mywndproc(
	WndID 		wId,
	unsigned16 	msg,
	unsigned16  nParam,
	unsigned32	lParam
);

static struct GC mygc;

static POINT mypoints[4] = {
	{30, 20},
	{60, 120},
	{70, 200},
	{30, 20}
};

static void WinMain(
	AppID	appID
)
{
	WndID	winid;
	if (appCount >= 2){
		appCount--;
		goto terminate;
	}

	/*  create some window */
	winid = CreateWindow(
		appID,
		NULL,
		MAINWND,
		mywndproc,
		0,
		0,
		200,
		240
	);

	/* example startx */
	GrGCSetForeColor(
		&mygc,
		0x0f
	);

	GrFillRect(winid, &mygc, 0, 0, 239, 319);
	
	GrGCSetForeColor(
		&mygc,
		0x00
	);

	GrLine(winid, &mygc, 0, 0, 239, 319, TRUE);	

	GrRect(winid, &mygc, 20, 20, 100, 100);

	GrPoly(winid, &mygc, 4, &mypoints[0]);
	
	while(SysGetAppMessage(appID)){
		AppHandleEvent(appID);
	}
	
terminate:	
	SysApplicationTermination();
}


static unsigned32 mywndproc(
	WndID 		wId,
	unsigned16 	msg,
	unsigned16  nParam,
	unsigned32	lParam
)
{
	return DefaultWndProc(wId, msg, nParam, lParam);
}


static unsigned32 myappproc(
	AppID 		app,
	unsigned16 	msg,
	unsigned16  nParam,
	unsigned32	lParam
)
{
	return DefaultAppProc(app, msg, nParam, lParam);
}

void myapplication()
{
	appCount++;
	
	CreateApplication(
		WinMain,
		myappproc,
		&appCount
	);
}

void hehe()
{
	emGUIInitialization();

	myapplication();
	myapplication();
}
_SysEvent _evSys_Snapshot;

⌨️ 快捷键说明

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