<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: UJWAL KC</title>
    <description>The latest articles on DEV Community by UJWAL KC (@ujwal_kc_d739e53427788535).</description>
    <link>https://dev.to/ujwal_kc_d739e53427788535</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2960159%2F418babeb-8dc4-45a2-bf3c-388ceb970856.png</url>
      <title>DEV Community: UJWAL KC</title>
      <link>https://dev.to/ujwal_kc_d739e53427788535</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ujwal_kc_d739e53427788535"/>
    <language>en</language>
    <item>
      <title>Setting Up the project for Game Engine (Rust Game Engine Dev #1)</title>
      <dc:creator>UJWAL KC</dc:creator>
      <pubDate>Thu, 20 Mar 2025 14:27:33 +0000</pubDate>
      <link>https://dev.to/ujwal_kc_d739e53427788535/setting-up-the-project-for-game-engine-rust-game-engine-dev-1-40hh</link>
      <guid>https://dev.to/ujwal_kc_d739e53427788535/setting-up-the-project-for-game-engine-rust-game-engine-dev-1-40hh</guid>
      <description>&lt;p&gt;So, Let's get started.&lt;/p&gt;

&lt;p&gt;I assume that you know the concepts of rust before diving in if not you can read my previous blog here &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/ujwal_kc_d739e53427788535" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2960159%2F418babeb-8dc4-45a2-bf3c-388ceb970856.png" alt="ujwal_kc_d739e53427788535"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/ujwal_kc_d739e53427788535/making-a-game-engine-using-rust-lang-rust-game-engine-dev-0-4kgh" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Making a Game Engine using rust lang. (Rust Game Engine Dev #0)&lt;/h2&gt;
      &lt;h3&gt;UJWAL KC ・ Mar 20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#rust&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#gameengine&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#opengl&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#sdl2&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;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&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cargo new yourprojectname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Manually adding dependencies on Cargo.toml file&lt;br&gt;
This way you name the dependencies followed by their version using double quote. Don't forget to save file after adding the dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[dependencies]
env_logger = "0.11.7"
gl = "0.14.0"
glam = "0.30.0"
pollster = "0.4.0"
sdl2 = "0.37.0"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or you can use &lt;code&gt;cargo add&lt;/code&gt; command. This adds the latest version automatically&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cargo add env_logger 
cargo add gl 
cargo add glam 
cargo add pollster 
cargo add sdl2 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt; If you want install same version as me paste the following code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that run &lt;code&gt;cargo build&lt;/code&gt; 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. &lt;/p&gt;

&lt;p&gt;Now lets talk about what those dependencies do &lt;/p&gt;

&lt;p&gt;env_logger : This is used for logging meaning it notes what is happening while running our code so debugging is easy. &lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;sdl2 : This is popular window creation library it handles user input, manages audio.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>projectsetup</category>
      <category>gameengine</category>
      <category>cargo</category>
    </item>
    <item>
      <title>Making a Game Engine using rust lang. (Rust Game Engine Dev #0)</title>
      <dc:creator>UJWAL KC</dc:creator>
      <pubDate>Thu, 20 Mar 2025 10:36:19 +0000</pubDate>
      <link>https://dev.to/ujwal_kc_d739e53427788535/making-a-game-engine-using-rust-lang-rust-game-engine-dev-0-4kgh</link>
      <guid>https://dev.to/ujwal_kc_d739e53427788535/making-a-game-engine-using-rust-lang-rust-game-engine-dev-0-4kgh</guid>
      <description>&lt;p&gt;So, I have major project coming up and i am developing game engine. You may think why game engine my answer is why not. It will make a good protfilo as well. And the reason i am choosing rust programming language for this project is that it has different syntax than typical programming language, it also has new concepts like borrowing ownership .... , and rust language is getting hyped. &lt;/p&gt;

&lt;p&gt;Another reason for using rust is it considered memory safe since i am making game engine for major project and i have less time so you don't have do memory management manually which saves time. &lt;/p&gt;

&lt;p&gt;I was thinking of using winit for window management and wgpu for rendering but i changed my mind and will use SDL2 for window management and OpenGL for rendering the reason for not using winit and wgpu is because i found their documentation sparse and hard to understand and i think it is not well documented as OpenGL and SDL2 and there are a lot of learning resources and tutorial for OpenGL and SDL2 which saves me a lot of time in research and since i have less time this is the safe and best choice for me and my major project.&lt;/p&gt;

&lt;p&gt;First you need to know rust programming language. You don't need to be professional at rust you just need enough knowledge in rust. You should have comprehensive knowledge on rust's Ownership, Borrowing, Lifetimes, Data Structure, Enums, Error Handling, Modules, Crates, Traits, Generics, Closures and Iterators. In programming you will "Learn as you" go so you don't need to have huge background knowledge on rust. You learn build skills along the way. According to me that is the proper way of learning programming and This is my first proper project that i am documenting and giving my full focus. I have some background in programming it is not that good. So this will be a little bit more challenging for me.&lt;/p&gt;

&lt;p&gt;I am using Ubuntu as my OS. FYI. &lt;/p&gt;

&lt;p&gt;And i will be documenting all the process as well and i will include learning resources that i used for developing this engine. So wish me good luck for this project. And if you have any recommendation for me you can tell me about it.&lt;/p&gt;

&lt;p&gt;It will take time for each post to publish since i am building the engine it is not built yet so don't worry if you don't see the further post for weeks. And i will create a post after i have completed a part of the project. I have divided the project in parts for each week so i don't feel overwhelm. Next will post will arrive in about a week after i achieve set milestone.&lt;/p&gt;

&lt;p&gt;Learning Resources For rust that i used &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The rust book : &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://doc.rust-lang.org/book/" rel="noopener noreferrer"&gt;
      doc.rust-lang.org
    &lt;/a&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Youtube Playlist : &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/OX9HJsJUDxA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rustling Exercise : &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rust-lang" rel="noopener noreferrer"&gt;
        rust-lang
      &lt;/a&gt; / &lt;a href="https://github.com/rust-lang/rustlings" rel="noopener noreferrer"&gt;
        rustlings
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      🦀 Small exercises to get you used to reading and writing Rust code!
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Rustlings 🦀❤️&lt;/h1&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Greetings and welcome to Rustlings
This project contains small exercises to get you used to reading and writing Rust code
This includes reading and responding to compiler messages!&lt;/p&gt;
&lt;p&gt;It is recommended to do the Rustlings exercises in parallel to reading &lt;a href="https://doc.rust-lang.org/book/" rel="nofollow noopener noreferrer"&gt;the official Rust book&lt;/a&gt;, the most comprehensive resource for learning Rust 📚️&lt;/p&gt;
&lt;p&gt;&lt;a href="https://doc.rust-lang.org/rust-by-example/" rel="nofollow noopener noreferrer"&gt;Rust By Example&lt;/a&gt; is another recommended resource that you might find helpful.
It contains code examples and exercises similar to Rustlings, but online.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Installing Rust&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Before installing Rustlings, you need to have the &lt;strong&gt;latest version of Rust&lt;/strong&gt; installed.
Visit &lt;a href="https://www.rust-lang.org/tools/install" rel="nofollow noopener noreferrer"&gt;www.rust-lang.org/tools/install&lt;/a&gt; for further instructions on installing Rust.
This will also install &lt;em&gt;Cargo&lt;/em&gt;, Rust's package/project manager.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;🐧 If you are on Linux, make sure you have installed &lt;code&gt;gcc&lt;/code&gt; (for a linker).&lt;/p&gt;
&lt;p&gt;Deb: &lt;code&gt;sudo apt install gcc&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Dnf: &lt;code&gt;sudo dnf install gcc&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;🍎 If you are on MacOS, make sure you have installed Xcode and…&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rust-lang/rustlings" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are the resources i used for learning rust and see you in next post after you learn rust. In next post we will discuss how to set up the project.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>gameengine</category>
      <category>opengl</category>
      <category>sdl2</category>
    </item>
  </channel>
</rss>
