Setting Up the project for Game Engine (Rust Game Engine Dev #1)
So, Let's get started. I assume that you know the concepts of rust before diving in if not you can read my previous blog here Making a Game Engine using rust lang. (Rust Game Engine Dev #0) UJWAL KC ・ Mar 20 #rust #gameengine #opengl #sdl2 I assume that you have already install rust and cargo on your computer. Go to your folder where you want to create the project. Then open your terminal and type cargo new yourprojectname This will create a project files with some default files i assume you know about it. Then you have to add dependencies on Cargo.toml file. You can do it in two ways. Manually adding dependencies on Cargo.toml file This way you name the dependencies followed by their version using double quote. Don't forget to save file after adding the dependencies. [dependencies] env_logger = "0.11.7" gl = "0.14.0" glam = "0.30.0" pollster = "0.4.0" sdl2 = "0.37.0" Or you can use cargo add command. This adds the latest version automatically cargo add env_logger cargo add gl cargo add glam cargo add pollster cargo add sdl2 NOTE If you want install same version as me paste the following code cargo add env_logger --version "0.11.7" cargo add gl --version "0.14.0" cargo add glam --version "0.30.0" cargo add pollster --version "0.4.0" cargo add sdl2 --version "0.37.0" After that run cargo build in your terminal this will download all the dependencies that you added to your Cargo.toml file. It will create Cargo.lock file and target folder i again assume you know about this as well. Now lets talk about what those dependencies do env_logger : This is used for logging meaning it notes what is happening while running our code so debugging is easy. gl : gl provides OpenGL API so you can easily use it on your project. Basically we use gl for rendering shaders or display 2D or 3D graphics on screen. glam : glam is a maths library for graphic. Don't be scared you just need to have basic knowledge about vectors, co-ordinates and matrices. glam is used for transforming our objects or movement of objects. pollster : This used to avoid the problems when we load assets our code might load all the resources at same time which might cause our program to crash to avoid such situation we use pollster. sdl2 : This is popular window creation library it handles user input, manages audio. This is it for this post. In next post we will talk about how to initialize the project into git and commit our project to github.

So, Let's get started.
I assume that you know the concepts of rust before diving in if not you can read my previous blog here

Making a Game Engine using rust lang. (Rust Game Engine Dev #0)
UJWAL KC ・ Mar 20
I assume that you have already install rust and cargo on your computer. Go to your folder where you want to create the project. Then open your terminal and type
cargo new yourprojectname
This will create a project files with some default files i assume you know about it. Then you have to add dependencies on Cargo.toml file. You can do it in two ways.
Manually adding dependencies on Cargo.toml file
This way you name the dependencies followed by their version using double quote. Don't forget to save file after adding the dependencies.
[dependencies]
env_logger = "0.11.7"
gl = "0.14.0"
glam = "0.30.0"
pollster = "0.4.0"
sdl2 = "0.37.0"
Or you can use cargo add
command. This adds the latest version automatically
cargo add env_logger
cargo add gl
cargo add glam
cargo add pollster
cargo add sdl2
NOTE If you want install same version as me paste the following code
cargo add env_logger --version "0.11.7"
cargo add gl --version "0.14.0"
cargo add glam --version "0.30.0"
cargo add pollster --version "0.4.0"
cargo add sdl2 --version "0.37.0"
After that run cargo build
in your terminal this will download all the dependencies that you added to your Cargo.toml file. It will create Cargo.lock file and target folder i again assume you know about this as well.
Now lets talk about what those dependencies do
env_logger : This is used for logging meaning it notes what is happening while running our code so debugging is easy.
gl : gl provides OpenGL API so you can easily use it on your project. Basically we use gl for rendering shaders or display 2D or 3D graphics on screen.
glam : glam is a maths library for graphic. Don't be scared you just need to have basic knowledge about vectors, co-ordinates and matrices. glam is used for transforming our objects or movement of objects.
pollster : This used to avoid the problems when we load assets our code might load all the resources at same time which might cause our program to crash to avoid such situation we use pollster.
sdl2 : This is popular window creation library it handles user input, manages audio.
This is it for this post. In next post we will talk about how to initialize the project into git and commit our project to github.