This repository was archived by the owner on Jun 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXMLLoader.h
More file actions
52 lines (44 loc) · 1.66 KB
/
XMLLoader.h
File metadata and controls
52 lines (44 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include <string>
#include <vector>
#include <windows.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
#include <directxmath.h>
#include <directxcolors.h>
#include <vector>
#include <algorithm>
#include <iostream>
#include <filesystem>
#include "rapidxml.hpp"
#include "rapidxml_iterators.hpp"
#include "rapidxml_print.hpp"
#include "rapidxml_utils.hpp"
#include "Input.h"
#include "Camera.h"
#include "GameObject.h"
#include "Structures.h"
//objects (expand as more children get created)
//TODO: instead of linking here, do it all in one header file, that constructs a list of available components which get chosen on runtime instead
#include "AtCam.h"
#include "ToCam.h"
#include "PathCam.h"
/*
* D3D11 Engine XML-Based Loading Library
* This is a small library I created from scratch that includes methods to populate an application's data
* This allowed me to encapsulate all of the XML code into one code document
*/
using namespace DirectX;
namespace XMLLoader {
//populate the arrays
void InitCameras(std::vector<Camera*>& cameraList, int windowWidth, int windowHeight);
void InitLights(std::vector<LightData>& lightList);
void InitGameObjects(std::vector<GameObject*>& objectList, ID3D11Device* d3dDevice);
//simple one struct loaders
FogSettings LoadFogSettings(std::string fileName);
//don't call any of these, they are helpers for the above functions
std::vector<rapidxml::xml_document<>*> GetAllXMLDocumentsInDir(std::string dirName);
rapidxml::xml_document<>* GetSingleXMLDocument(std::string fileName);
XMFLOAT3 GetFloat3InXml(rapidxml::xml_node<>* node);
XMFLOAT4 GetColorInXml(rapidxml::xml_node<>* node);
}