61 lines
956 B
C++
61 lines
956 B
C++
#include "dl_type.h"
|
|
#include "dl_range.h"
|
|
#include "dl_io.h"
|
|
#include "dl_string.h"
|
|
#include "dl_system.h"
|
|
#include "dl_time.h"
|
|
#include "render/dl_sprite.h"
|
|
#include "render/dl_factory.h"
|
|
#include "dl_engine.h"
|
|
|
|
using namespace dl;
|
|
|
|
struct Base
|
|
{
|
|
gcSprite spr;
|
|
gcText txt;
|
|
};
|
|
Base* base;
|
|
|
|
void Run()
|
|
{
|
|
//spr = g_factory
|
|
//log(std::to_string(g_time->GetFPS()));
|
|
if (!base)
|
|
{
|
|
base = new Base;
|
|
base->spr = g_factory->CreateSpriteDefault();
|
|
|
|
base->txt = g_factory->CreateTextDefault();
|
|
base->txt->SetFontSize(120);
|
|
base->txt->SetString("C++ drawing libaray");
|
|
}
|
|
|
|
base->spr->Render();
|
|
base->txt->Render();
|
|
}
|
|
|
|
int main()
|
|
{
|
|
Engine::Init();
|
|
|
|
log("hello dl!");
|
|
log("中文");
|
|
constexpr Point a{100, 100};
|
|
constexpr Point b{200, 200};
|
|
|
|
constexpr Point c = a + b;
|
|
|
|
constexpr Point d = Every::Clamp(c, 120, 150);
|
|
|
|
log(to_string(d));
|
|
|
|
|
|
|
|
g_time->SetFPS(60);
|
|
g_system->SetFuncRun(Run);
|
|
g_system->Start();
|
|
|
|
Engine::Release();
|
|
return 0;
|
|
} |