hunting/middleware/GuiEngine/lvgl_board/LvglBoard.cpp
zhoulongyu 45d0acca40 [zhoulongyu]:
Modify the names of some of the abstract classes associated with Lvgl
2024-08-06 00:36:51 +08:00

25 lines
739 B
C++
Executable File

#include "lvgl_board_main.h"
#include "LvglBoard.h"
#include <iostream>
#include <thread>
bool CreateGuiEngineImpl()
{
std::shared_ptr<VGuiEngine> impl = std::move(std::make_shared<LvglLinuxBoard>());
VGuiEngine::GetInstance(&impl);
return true;
}
bool LvglLinuxBoard::Init(const unsigned int width, const unsigned int height, void (*appInit)())
{
auto mainFunc = [](const unsigned int width_, const unsigned int height_, void (*appInit_)())
{
lvgl_board_main(width_, height_, appInit_);
};
std::thread(mainFunc, width, height, appInit).detach();
return true;
}
void LvglLinuxBoard::UnInit()
{
lvgl_board_exit();
std::cout << "LvglLinuxBoard UnInit." << std::endl;
}