diff --git a/Thesis/Thesis.tex b/Thesis/Thesis.tex index dce0d8f..c97d353 100644 --- a/Thesis/Thesis.tex +++ b/Thesis/Thesis.tex @@ -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. diff --git a/Thesis/images/main.drawio b/Thesis/images/main.drawio new file mode 100644 index 0000000..e9e3869 --- /dev/null +++ b/Thesis/images/main.drawio @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Thesis/images/mainFunction.pdf b/Thesis/images/mainFunction.pdf new file mode 100644 index 0000000..027a113 Binary files /dev/null and b/Thesis/images/mainFunction.pdf differ