dl
dl::System类 参考

系统 更多...

#include <dl_system.h>

Public 类型

enum class  CursorMode { NORMAL , HIDE , DISABLE }
 
using Func = void (*)(void)
 

Public 成员函数

 System ()
 
 ~System ()
 
void Start (std::string_view json_window, std::string_view json_path="")
 进入 游戏循环
 
void Start (const ParamWindow &param={})
 创建窗口 并进入 游戏循环
 
void Exit ()
 创建窗口 并进入 游戏循环
 
void SetFuncInit (Func func)
 设置 初始化函数
 
void SetFuncRun (Func func)
 设置 帧函数
 
void SetCursorPosition (Point xy)
 设置鼠标位置,不用此来实现摄像机
 
Size GetWindowSize ()
 返回窗口大小
 
Size GetWorkArea ()
 获取桌面大小,不包含任务栏
 
void SetWindowPoint (const Point &xy)
 设置窗口位置
 
void SetWindowCenter ()
 设置窗口居中(以工作区大小)
 
void SetWindowTitle (std::string_view str)
 设置窗口标题
 
bool IsWindowExist ()
 窗口是否存在
 
const RenderInfo2DGetRenderInfo2D ()
 返回上一帧绘图信息
 
const RenderInfo3DGetRenderInfo3D ()
 
void ScreenShot (std::string_view path_name)
 截屏
 
void SetCursorMode (CursorMode mode)
 设置光标模式
 
void SetClipboardString (std::string_view str)
 设置剪贴板
 
std::string GetClipboardString ()
 返回剪贴板
 
void ClearDropFile ()
 清空拖入文件列表
 
const std::vector< std::string > & GetDropFile ()
 返回拖入文件列表
 
void ShowMessageBox (std::string_view title, std::string_view text)
 系统框提示
 
void SetFullScreen (FullScreenMode mode, const Size &size={})
 设置全屏
 
void SetWindowSize (const Size &size)
 设置窗口大小
 
void SetWindowDirection (WindowDirection dir)
 
WindowDirection GetWindowDirection ()
 返回屏幕方向
 
SystemStep GetStep ()
 返回引擎运行状态
 
std::string GetHardwareId ()
 硬件码(md5 长度32)
 
std::string GetUsername ()
 返回用户名
 
void Pause ()
 暂停程序,等待用户输入后继续(Windows:按任意键;其他平台:回车)
 
void _add_drop_file (std::string_view str)
 内部调用
 
SystemImp * GetImp ()
 
void _init_glfw ()
 
void _delete_glfw ()
 
void _resize ()
 
void _set_dir (WindowDirection dir)
 
void _convert_glfw_to_system (Point &xy)
 
void _convert_system_to_glfw (Point &xy)
 
void lua_SetFuncInit (luabridge::LuaRef func)
 
void lua_SetFuncRun (luabridge::LuaRef func)
 

详细描述

系统

在文件 dl_system.h67 行定义.

成员类型定义说明

◆ Func

using dl::System::Func = void (*)(void)

在文件 dl_system.h70 行定义.

成员枚举类型说明

◆ CursorMode

enum class dl::System::CursorMode
strong
枚举值
NORMAL 
HIDE 
DISABLE 

在文件 dl_system.h141 行定义.

构造及析构函数说明

◆ System()

dl::System::System ( )

◆ ~System()

dl::System::~System ( )

成员函数说明

◆ _add_drop_file()

void dl::System::_add_drop_file ( std::string_view str)
inline

内部调用

在文件 dl_system.h212 行定义.

◆ _convert_glfw_to_system()

void dl::System::_convert_glfw_to_system ( Point & xy)

◆ _convert_system_to_glfw()

void dl::System::_convert_system_to_glfw ( Point & xy)

◆ _delete_glfw()

void dl::System::_delete_glfw ( )

◆ _init_glfw()

void dl::System::_init_glfw ( )

◆ _resize()

void dl::System::_resize ( )

◆ _set_dir()

void dl::System::_set_dir ( WindowDirection dir)
inline

在文件 dl_system.h226 行定义.

◆ ClearDropFile()

void dl::System::ClearDropFile ( )
inline

清空拖入文件列表

在文件 dl_system.h165 行定义.

◆ Exit()

void dl::System::Exit ( )

创建窗口 并进入 游戏循环

◆ GetClipboardString()

std::string dl::System::GetClipboardString ( )

返回剪贴板

◆ GetDropFile()

const std::vector< std::string > & dl::System::GetDropFile ( )
inline

返回拖入文件列表

在文件 dl_system.h172 行定义.

◆ GetHardwareId()

std::string dl::System::GetHardwareId ( )

硬件码(md5 长度32)

◆ GetImp()

SystemImp * dl::System::GetImp ( )
inline

在文件 dl_system.h217 行定义.

◆ GetRenderInfo2D()

const RenderInfo2D & dl::System::GetRenderInfo2D ( )

返回上一帧绘图信息

◆ GetRenderInfo3D()

const RenderInfo3D & dl::System::GetRenderInfo3D ( )

◆ GetStep()

SystemStep dl::System::GetStep ( )
inline

返回引擎运行状态

在文件 dl_system.h199 行定义.

◆ GetUsername()

std::string dl::System::GetUsername ( )

返回用户名

◆ GetWindowDirection()

WindowDirection dl::System::GetWindowDirection ( )
inline

返回屏幕方向

在文件 dl_system.h196 行定义.

◆ GetWindowSize()

Size dl::System::GetWindowSize ( )

返回窗口大小

◆ GetWorkArea()

Size dl::System::GetWorkArea ( )

获取桌面大小,不包含任务栏

◆ IsWindowExist()

bool dl::System::IsWindowExist ( )

窗口是否存在

◆ lua_SetFuncInit()

void dl::System::lua_SetFuncInit ( luabridge::LuaRef func)

◆ lua_SetFuncRun()

void dl::System::lua_SetFuncRun ( luabridge::LuaRef func)

◆ Pause()

void dl::System::Pause ( )

暂停程序,等待用户输入后继续(Windows:按任意键;其他平台:回车)

◆ ScreenShot()

void dl::System::ScreenShot ( std::string_view path_name)

截屏

◆ SetClipboardString()

void dl::System::SetClipboardString ( std::string_view str)

设置剪贴板

◆ SetCursorMode()

void dl::System::SetCursorMode ( CursorMode mode)

设置光标模式

注解
调用后,会触发光标移动事件,会强制鼠标两帧间隔归0s

◆ SetCursorPosition()

void dl::System::SetCursorPosition ( Point xy)

设置鼠标位置,不用此来实现摄像机

参数
[in]xy位置
注解
使用g_input获得鼠标位置

◆ SetFullScreen()

void dl::System::SetFullScreen ( FullScreenMode mode,
const Size & size = {} )

设置全屏

◆ SetFuncInit()

void dl::System::SetFuncInit ( Func func)
inline

设置 初始化函数

在文件 dl_system.h93 行定义.

◆ SetFuncRun()

void dl::System::SetFuncRun ( Func func)
inline

设置 帧函数

在文件 dl_system.h97 行定义.

◆ SetWindowCenter()

void dl::System::SetWindowCenter ( )

设置窗口居中(以工作区大小)

◆ SetWindowDirection()

void dl::System::SetWindowDirection ( WindowDirection dir)
inline

在文件 dl_system.h190 行定义.

◆ SetWindowPoint()

void dl::System::SetWindowPoint ( const Point & xy)

设置窗口位置

◆ SetWindowSize()

void dl::System::SetWindowSize ( const Size & size)

设置窗口大小

◆ SetWindowTitle()

void dl::System::SetWindowTitle ( std::string_view str)

设置窗口标题

◆ ShowMessageBox()

void dl::System::ShowMessageBox ( std::string_view title,
std::string_view text )

系统框提示

参数
[in]title标题
[in]text内容

◆ Start() [1/2]

void dl::System::Start ( const ParamWindow & param = {})

创建窗口 并进入 游戏循环

◆ Start() [2/2]

void dl::System::Start ( std::string_view json_window,
std::string_view json_path = "" )

进入 游戏循环

参数
[in]json_window窗口配置
[in]json_path资源路径配置

类成员变量说明

◆ _funcInit

luabridge::LuaRef dl::System::_funcInit { g_lua->GetL() }

在文件 dl_system.h251 行定义.

◆ _funcRun

luabridge::LuaRef dl::System::_funcRun { g_lua->GetL() }

在文件 dl_system.h252 行定义.


该类的文档由以下文件生成: