mirror of
https://github.com/kuhyx/engineer-thesis-WUT.git
synced 2026-07-04 11:43:05 +02:00
feat: added main function flowchart
This commit is contained in:
parent
ef1740f52b
commit
03c3c0d353
@ -31,6 +31,14 @@
|
||||
% tytul 2 poziomu 13
|
||||
% tytul 3 poziomu 12
|
||||
\usepackage{sectsty}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{shapes.geometric, arrows, positioning}
|
||||
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]
|
||||
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
|
||||
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
|
||||
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
|
||||
\tikzstyle{arrow} = [thick,->,>=stealth]
|
||||
|
||||
|
||||
\chapterfont{\fontsize{14}{14}\selectfont}
|
||||
|
||||
@ -1031,6 +1039,44 @@ The engine's architecture is segmented into modules:
|
||||
.2 CmakLists.txt\DTcomment{Holds instructions for how to build the engine}.
|
||||
}
|
||||
|
||||
\section{Main game loop}
|
||||
\begin{figure}[htp]
|
||||
\centering
|
||||
\begin{tikzpicture}[node distance=2cm]
|
||||
\useasboundingbox (-5,0) rectangle (5, -17); % Set a custom bounding box
|
||||
\node (start) [startstop] {Enter main function};
|
||||
\node (pro1) [process, below of=start] {Initialize GLFW};
|
||||
\draw [arrow] (start) -- (pro1);
|
||||
|
||||
\node (pro2) [process, below of=pro1] {Initialize window};
|
||||
\draw [arrow] (pro1) -- (pro2);
|
||||
\node (pro3) [process, below of=pro2] {Load OpenGL};
|
||||
\draw [arrow] (pro2) -- (pro3);
|
||||
|
||||
\node (pro4) [process, below of=pro3] {Initialize game};
|
||||
\draw [arrow] (pro3) -- (pro4);
|
||||
|
||||
\node (pro5) [process, below of=pro4] {Main Loop};
|
||||
\draw [arrow] (pro4) -- (pro5);
|
||||
|
||||
\node (dec1) [decision, below of=pro5] {Closed?};
|
||||
\draw [arrow] (pro5) -- (dec1);
|
||||
% Arrow from 'Closed?' decision node to 'Main Loop' node
|
||||
\draw [arrow] (dec1.east) -- ++(2,0) |- node[anchor=south] {no} (pro5);
|
||||
|
||||
\node (pro6) [process, below of=dec1] {Free resources};
|
||||
\draw [arrow] (dec1) -- node[anchor=east] {yes} (pro6);
|
||||
|
||||
\node (close) [startstop, below of=pro6] {Close};
|
||||
\draw [arrow] (pro6) -- (close);
|
||||
\end{tikzpicture}
|
||||
\caption{Main function logic}
|
||||
\label{fig:main_function_logic}
|
||||
\end{figure}
|
||||
|
||||
\paragraph{GLFW initialization}
|
||||
Very first operation of our engine is to initliaze GLFW context, window and openGL
|
||||
|
||||
\subsection{Dependency Management}
|
||||
There are several libraries: OpenGL, GLFW, stb\_image and freetype being integrated into engine, they are simply included at the top of any files that need them.
|
||||
|
||||
|
||||
82
Thesis/images/main.drawio
Normal file
82
Thesis/images/main.drawio
Normal file
@ -0,0 +1,82 @@
|
||||
<mxfile host="app.diagrams.net" modified="2023-08-29T11:58:50.154Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" etag="gB0byvFmaiuhVk3RewDL" version="21.6.9" type="device">
|
||||
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
|
||||
<mxGraphModel dx="790" dy="1049" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
|
||||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=16;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-3" target="jL2h_wYrxs0-GGsbEkt9-0">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-3" value="Enter main function" style="rounded=1;whiteSpace=wrap;html=1;fontSize=16;glass=0;strokeWidth=1;shadow=0;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
|
||||
<mxGeometry x="341" y="10" width="120" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=16;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="jL2h_wYrxs0-GGsbEkt9-0" target="jL2h_wYrxs0-GGsbEkt9-1">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-0" value="Initialize GLFW" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=16;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="341" y="70" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=16;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="jL2h_wYrxs0-GGsbEkt9-1" target="jL2h_wYrxs0-GGsbEkt9-3">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-1" value="Initialize window" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=16;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="341" y="150" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=16;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="jL2h_wYrxs0-GGsbEkt9-3" target="jL2h_wYrxs0-GGsbEkt9-4">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-3" value="Load OpenGL" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=16;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="341" y="230" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=16;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="jL2h_wYrxs0-GGsbEkt9-4" target="jL2h_wYrxs0-GGsbEkt9-5">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-4" value="Initialize game" style="rounded=1;whiteSpace=wrap;html=1;glass=0;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=16;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="341" y="310" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=16;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="jL2h_wYrxs0-GGsbEkt9-5" target="jL2h_wYrxs0-GGsbEkt9-6">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-5" value="Main Loop" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=16;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="341" y="400" width="120" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;fontSize=16;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="jL2h_wYrxs0-GGsbEkt9-6" target="jL2h_wYrxs0-GGsbEkt9-5">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="510" y="565" />
|
||||
<mxPoint x="510" y="440" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-10" value="NO" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=16;" vertex="1" connectable="0" parent="jL2h_wYrxs0-GGsbEkt9-9">
|
||||
<mxGeometry x="-0.2466" y="-1" relative="1" as="geometry">
|
||||
<mxPoint x="-1" y="-44" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=16;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="jL2h_wYrxs0-GGsbEkt9-6" target="jL2h_wYrxs0-GGsbEkt9-11">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-16" value="YES" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=16;" vertex="1" connectable="0" parent="jL2h_wYrxs0-GGsbEkt9-13">
|
||||
<mxGeometry x="-0.2" y="2" relative="1" as="geometry">
|
||||
<mxPoint x="-2" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-6" value="Game closed?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=16;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="340" y="500" width="122" height="130" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=16;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="jL2h_wYrxs0-GGsbEkt9-11" target="jL2h_wYrxs0-GGsbEkt9-12">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-11" value="Free resources" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=16;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="342" y="690" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-12" value="Close" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=16;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="342" y="780" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="jL2h_wYrxs0-GGsbEkt9-23" value="" style="swimlane;startSize=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="269" width="264" height="860" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
BIN
Thesis/images/mainFunction.pdf
Normal file
BIN
Thesis/images/mainFunction.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user