Пример #1
0
DXWindow::DXWindow(UINT width, UINT height, std::wstring name):
	width(width),
	height(height),
	useWarpDevice(false)
{
	ParseCommandLineArgs();

	title = name + (useWarpDevice ? L" (WARP)" : L"");

	WCHAR nassetsPath[512];
	GetAssetsPath(nassetsPath, _countof(nassetsPath));
	assetsPath = nassetsPath;

	aspectRatio = static_cast<float>(width) / static_cast<float>(height);
}
Пример #2
0
int main()
{
	GuiImage* editorStartupImg = EditorGui.AddImage(GetAssetsPath() + "editor_startup.jpg");

	WindowDesc windowDesc;
		windowDesc.clientSize = editorStartupImg->GetDimension();
		windowDesc.style = eWindowStyle::DEFAULT;
	Window* window = new Window(windowDesc);


	rGraphicsEngineRT graphicsDesc;
		graphicsDesc.targetWindow = window;
	//Core.InitGraphicsEngineRasterZsiros(graphicsDesc); // ...
	Core.InitPhysicsEngineBullet();
	
	Actor* ground = World.AddActor("box.DAE", 0);
	ground->SetKinematic(true);
	ground->SetScale(mm::vec3(100, 100, 1));
	ground->SetName("ground");

	// TMP !!
	//World.AddScript<TestLevelScript>();

	Timer* timer = new Timer();

	while (window->IsOpen())
	{
		WindowEvent evt;
		while (window->PopEvent(evt));

		float deltaTime = timer->GetSecondsPassed();
		timer->Reset();

		Core.Update(deltaTime);
		
		static uint64_t magic = 0;
		magic++;
		if((magic % 100) == 0)
			window->SetTitle("Fps: " + std::to_string(1.f / deltaTime));
	}
	
	getch();

//	delete pixels;
	delete window;
	delete timer;
	return 0;
}
Пример #3
0
void LovecraftApp::Tests() const
{
    //TMX loading test
    tmxparser::TmxReturn error;
    tmxparser::TmxMap map;

    // test from file
    CYIString assetPath = GetAssetsPath();

    CYIString levelPath = assetPath + "resources/" + "test_xml_level.tmx";

    error = tmxparser::parseFromFile(levelPath.GetData(), &map, assetPath.GetData());

    // Quest test
    QuestList* quests = QuestList::FromJSON(assetPath + "resources/Quests.json");

    YI_LOGI("LovecraftApp::UserStart", "%s", quests->ToString().GetData());

    delete quests;
    
}