WGPU for beginners 1: window and event loop

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ค. 2024
  • #gamedev #gamedevelopment #programming
    Discord: / discord
    Patreon: patreon.com/user?u=58955910
    Code: github.com/amengede/wgpu
    Playlist: • WGPU

ความคิดเห็น • 18

  • @yew7607
    @yew7607 3 หลายเดือนก่อน +2

    I was really struggling with all these deprecated tutorials and then you come along. Thank you so much

  • @RealPnoenix
    @RealPnoenix 3 หลายเดือนก่อน +1

    Thank you so much! I coudln't for the life of me find a tutorial that was less than a year old ❤

  • @shailendrajadhav8603
    @shailendrajadhav8603 3 หลายเดือนก่อน +1

    Awesome!, I did watch some other videos on this subject and found your version better to follow as I am just starting out learning the wgpu as well as rust.

  • @shanebenlolo3160
    @shanebenlolo3160 3 หลายเดือนก่อน

    Nice! When you set up your camera, can you take extra care to set up the view_proj matrix when targeting the browser vs native? I have my matrix working correctly on native but it’s wrong on the browser (after following the sorth tutorial). Thanks so much look forward to following this tutorial.
    Also my depth buffer does not work natively but it does on the browser? On native my entire windows is just my clear color and nothing else… Not sure if anyone else is having this issue but I’ve been meaning to post about it so I’m just doing it here lol

  • @Null-xf6so
    @Null-xf6so หลายเดือนก่อน +1

    can we just replace learn-wgpu with this? 100 percent has my support if you ever do written docs for your repo lol. was ready to break out the pitchforks after chasing down the correct lifetime parameters all day. thanks man great work here

    • @GetIntoGameDev
      @GetIntoGameDev  หลายเดือนก่อน

      Thankyou, I’ll consider writing up some proper documentation 🙂

  • @triq0
    @triq0 15 วันที่ผ่านมา

    yo, i think they updated winit since this tutorial was posted, since they removed window::WindowBuilder, and moved window creation to be done by the ActiveEventLoop, which is available as a parameter of a required function for the implementation of the ApplicationHandler trait. i will admit i'm not very experienced with rust. i like this change because its more readable in my opinion, but i'm having a lot of difficulty figuring out where i need to create the wgpu surface for example (inside the ApplicationHandler resumed function? in a struct that the app which implements ApplicationHandler will have ownership of?) i would love to see a working example of a simple program that uses wgpu and winit with these changes. please, any tips of a point in the right direction would be appreciated 🙏

    • @triq0
      @triq0 14 วันที่ผ่านมา

      everything is possible as long as you keep trying. i just figured it out lol, and to answer my question in case anyone is wondering: do all the relevant wgpu initialization inside the resumed function after the window is created, and put the information that you'll need in the RedrawRequest event (ex: render_pipeline: Option, device: Option , queue ... , etc.) in the App struct (that implements ApplicationHandler) alongside the window: Option to be filled out as you go. i was getting stumped on assigning self.surface to a surface that i created using instance.create_surface(self.window.expect("nothing here")).expect("failed to create surface"); using expect or unwrap was causing issues with lifetimes, meaning the app struct implementing this would have to live longer than itself in order to supply a window to its own surface. i think this is because unwrap "consumes" the self (which i'm not really sure the meaning of). since all we want is the Window for instance.create_surface (and i'm slightly sure we don't need the Window itself for anything), we can use self.window.take() which is going to replace self.window with None, and then give the resulting Window to the instance.create_surface method to be created 💥 i'm not sure if thats the right way to go about handling ownership, but it worked so hell yea.
      one more thing about handling asynchronous creation of wgpu structs (since i was very confused about this before): i'm using pollster::block_on( async { /* wgpu async method call */ })

  • @xbz24
    @xbz24 3 หลายเดือนก่อน

    niceeeeeeee

  • @Mikenaut
    @Mikenaut 3 หลายเดือนก่อน +1

    I've been waiting for this series for a while, since I'm trying to create a mini software to render a framebuffer on the screen with wgpu, but I would like videos a little more frequently (I absolutely don't want to create controversy about it, it was just my feedback).

  • @CoolestPossibleName
    @CoolestPossibleName 3 หลายเดือนก่อน +3

    Your video found me

    • @danisob3633
      @danisob3633 3 หลายเดือนก่อน +1

      As it should

  • @pixelusion2311
    @pixelusion2311 3 หลายเดือนก่อน

    Is it another series? What would be the reason to follow this instead of your previous one?

    • @fyrebirdd
      @fyrebirdd 2 หลายเดือนก่อน

      previous one is in typescript, this is in rust

  • @SkyFly19853
    @SkyFly19853 3 หลายเดือนก่อน +2

    But you are doing it in Linux... 😏

    • @blockedchannel7032
      @blockedchannel7032 3 หลายเดือนก่อน +1

      Something wrong?)

    • @GetIntoGameDev
      @GetIntoGameDev  3 หลายเดือนก่อน +4

      The joke is: not Windows
      Haha, nice one 🤣

    • @SkyFly19853
      @SkyFly19853 3 หลายเดือนก่อน

      @@GetIntoGameDev
      Oh...
      Alright then...
      Just like Jim Carrey...
      😏