The Best way to make GUI Apps as a Game Developer

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

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

  • @macgyverswissarmykni
    @macgyverswissarmykni 8 หลายเดือนก่อน +33

    Been using egui for almost 3 years now, it's been great for my desktop app development. Especially considering that the Rust GUI ecosystem is still somewhat in its infancy, this option has been great and enjoys good support from its author.

  • @loganbries3867
    @loganbries3867 8 หลายเดือนก่อน +20

    By the way, instead of needing to add egui as another dependency, eframe re-exports the entirety of egui under eframe::egui. So it's possible to remove egui as a dependency entirely.

  • @helleye311
    @helleye311 8 หลายเดือนก่อน +6

    Pretty neat! I've been looking for a rust lib for simple UI. Not entirely sold on immediate ui, but for replacing simple cli with button clicks it seems great!

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

    This was really awesome, when I first looked at rust about...idk lets say 4-5 years ago, it was a pain to get simple stuff going, but once I got the simple stuff working, things like GUI was my next target and in almost every langauge GUI is not a simple thing, its more of a process, This video shows that next step and kinda shows how simple it can be...rust being the biggest hurdle instead of the GUI lib itself, Thanks for this video bro.

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

    Great video, I hope there's more to come! In the mean time, I will take this opportunity to learn how to make GUI apps lol.
    I'm sick of the usual tutorial series though.
    If you could just share the sort of abridged version of your experience building a project, like the thought process and the hurdles (big & small) and the way you cleared them, that would be super appreciated!

  • @m4rt_
    @m4rt_ 8 หลายเดือนก่อน +7

    you could use imgui, it may not be the most pretty UI, but it works.
    And if you want some more control over how it works, you could just make it from scratch like you would with making a normal game with OpenGL or whatever graphics API you prefer, or maybe SDL or Raylib. Though, doing it this way may lead to having some more work than you would usually do, but you get to do it the same way you make games, and you get more control over how it looks.

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

      ImGui and egui are both highly customizable. I don't think the appearance is an issue for most people tbh.

  • @LukasSmith827
    @LukasSmith827 8 หลายเดือนก่อน +2

    Very nice!
    I'm gonna consider this for planning my game

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

    I've been making GUI apps in Godot with the Rust bindings. There's a project setting to use less CPU (be less game-like by only updating on events rather then rerendering as fast as possible). It's nice to be able to make a VR view of several GUIs, or to be able to just render a 3D model as part of the GUI.

  • @famshare-esl2453
    @famshare-esl2453 2 หลายเดือนก่อน

    This is my first time seeing your channel, but I've just subscribed in hopes of coming eGui tutorials. I really think eGui is important. A guy opens up tools to a lot of people, and opens up ways of presenting info. But most guis seems focused on helping front-end teams, separate from backend teams. For small, single developer or small team tools, I want a low maintenance logically transparent tool. I think of it as being an evolution of the CLI program. That said, it's more involved than call and I constantly find myself starting and not quite jumping in. (e.g. displaying Polars tables to make interactive data analysis tools -- but there's just ... a lot of little options and it's easy to get side tracked.)). Rerun is also one of those amazing tools (focused on multimodal data presentation) that I'd like to see -- and may have game dev utility, some day. Just to put that out there :)

  • @sid.h
    @sid.h 8 หลายเดือนก่อน +21

    Kotlin Compose Multiplatform will be perfect for this once it gets stable 🙏

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

      You know you actually can grab any light open source web browser and just do your GUI with html/canvas API? You don't need to wait for Compose to do the same thing. Goland have quite similar project called Muon. If you can significantly shrink webkit based browser by removing unnecessary modules.

    • @codingwithsphere
      @codingwithsphere  8 หลายเดือนก่อน +4

      I've never heard of this until now. I'll check it out!

    • @FahadAyaz
      @FahadAyaz 8 หลายเดือนก่อน +1

      I'm building a multiplatform, multiplayer game and a utility app in Compose Multiplatform. They're both side projects though, so the amount of time I can focus on them is limited. But I'll get there!
      Android dev is my day job so picking up Compose Multiplatform has been a breeze!

    • @asandax6
      @asandax6 8 หลายเดือนก่อน +1

      Ahh yes Flutter for the JVM

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

      ​​@@asandax6Yes and no. Yes on Android and desktop, no on iOS or JS or WebAssembly. Plus I find that interop generally works much better with Kotlin than it does with Dart.

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

    great video bro , and yes we need more videos about egui and rust make it a series

  • @nrwchd
    @nrwchd 8 หลายเดือนก่อน +9

    there are reasons why commercial GUI program using tree based hierarchy and event callbacks, they can be drawn lazily. If no interaction happens no needs to redraw, saving a lot of CPU cycles.

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

      tbf egui also has a lazy rendering model

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

      @@dorktales254 didn't know that, I thought it was 1 to 1 ImGUI clone. but, still it has to check all possible branch if event occurred. tree based hierarchy only needs to call the callback specified at the beginning.

  • @DerSolinski
    @DerSolinski 8 หลายเดือนก่อน +2

    If you want to understand why leaving a line without the semicolon isn't a quirk and rather a consequent implementation of how programming languages work,
    you can read up on the difference between a statement and an expression.
    And then you can look up what Rust defines as such.
    Once you get a grasp of those fundamental concepts you will have a lot more fun programming in general.

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

    Making GUI apps is something I want to get into as well. I really would love for something to be as easy to style as Electron is thanks to relying on CSS... but for native desktop apps. QT honestly looks like a pain to work in (just from a glance) and doesn't even look good. Will probably explore Flutter for that!

  • @letronix6243
    @letronix6243 8 หลายเดือนก่อน +1

    I click on a random video and it goes into egui, something I am also working on. Coincidences happen so much.

  • @rawallon
    @rawallon 8 หลายเดือนก่อน +18

    I thought Rust could only be written on vim

    • @no_name4796
      @no_name4796 8 หลายเดือนก่อน +8

      And you need blue hair

    • @aimpizza6823
      @aimpizza6823 8 หลายเดือนก่อน +5

      @@no_name4796 and a split keyboard

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

      @@aimpizza6823 Or a Thinkpad

  • @coding-master-shayan
    @coding-master-shayan 7 หลายเดือนก่อน +1

    Sir which vs code theme are you using?

  • @faimenDev
    @faimenDev 8 หลายเดือนก่อน +1

    Thx for sharing it

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

    how about slint

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

    I would love a tutorial Series on this.

  • @tiranito2834
    @tiranito2834 8 หลายเดือนก่อน +24

    "e-GUI is an immediate mode UI library written in Rust"
    And like that, you've lost me.

    • @Omega-mr1jg
      @Omega-mr1jg 8 หลายเดือนก่อน +8

      Your loss for falling under the trap of "rust sux" bubbles

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

      lol I understand

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

    I'm not a fan of Rust and immediate mode GUIs (aside from quick tools), but this was still somewhat interesting to watch

  • @mohammednihad6755
    @mohammednihad6755 5 หลายเดือนก่อน +1

    "I tried Electron but I don't like writing JavaScript, and the bundle size is too large"
    Well why not use Tauri then? Since you already write Rust, and its bundle size is so small?
    I never used Tauri though, just a thought...

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

    cargo add --features

  • @nullpointer1755
    @nullpointer1755 8 หลายเดือนก่อน +1

    Immediate mode GUI's are fine until you decide to use more advanced layouts, like flex box or grid.

    • @codingwithsphere
      @codingwithsphere  8 หลายเดือนก่อน +1

      This is true. I wouldn't use it for the front page of a website. However, there are some great examples of cool layouts in the egui community.

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

    petition for making sphere to continue the opentk minecraft tutorials, maybe think of making series for glsl, Thanks for the amazing tutorials though❤

  • @RuslanKovtun
    @RuslanKovtun 8 หลายเดือนก่อน +2

    0:25 - have you tried FLTK?

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

      I haven't yet

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

      it looks like shit

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

    Thanks bro

  • @ursochurrasqueira
    @ursochurrasqueira 8 หลายเดือนก่อน +1

    have you tried Flutter?

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

    I've used Iced to build a gui app with Rust earlier this year but haven't gotten around to egui yet. Does anyone have experience with both and some insight into which they prefer?

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

    Great vid brother, Can you do a VSCode setup to have one similar to yours ?

  • @nshout
    @nshout 8 หลายเดือนก่อน +2

    Name your Visual Studio Code theme!

  • @Terrados1337
    @Terrados1337 8 หลายเดือนก่อน +4

    Rust code looks like someone who watched too many python tutorials on YT created their own language with the best intentions.
    But stuff like returning when no semi colon is uh ... it has that "look at me, I'm so quirky!"-vibe to it.
    Don't get me wrong, I like Rust. Comprehensive error codes should be default in any language but apparently ferrous oxide can do that. But I also like readable code. Constructing a constructor in a constructor in a function call (and for some reason taking the absolute value of that) while adding ascii code smiley faces to parameters ... maybe readable for an n-th degree Rust wizard. But not for a human.

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

      agreed

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

      I agree with the no semicolon return. I really dont like it

    • @daliareds
      @daliareds 8 หลายเดือนก่อน +5

      Rust is an expression based language, like the functional languages it takes inspiration from. That means that each and every single line of code that ends in a semicolon returns `()`, which is the unit type. Therefore, you only need to remove said semicolon to return the evaluation of the current expression. It's not a thing done only to be quirky, it's a consequence of the design decisions taken when making the language. I completely understand you don't like it and that's fair. But language syntax is not really that important once you get familiarized enough, it all goes away with practice

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

      @@daliareds is there any use to this inspiration from functional languages?

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

      @@ghostsdefeated4078 Yeah, there is. If you look at something like Ocaml, you'll recognize Rust's DNA everywhere. It's in things like it's algebraic data types, that gives you the Option and Result types, pattern matching, inmutable data by default, tail call optimizations, etc. There's a lot of expressivity in functional languages that has no real equivalent in procedural or oop

  • @Nickname863
    @Nickname863 8 หลายเดือนก่อน +2

    I see a lot of tools being made with godot, maybe try that too if you find the time some day.

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

    Something similar written in C is nuklear.

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

    Just curious with not using Monogame and Imgui? That's what I use for immediate mode GUI apps and it's honestly really easy to work with! I loved working with Rust in the past when learning bevy but Rust is always kinda scary

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

      Rust is very scary I will say. There are some issues I have with imgui that aren't really its fault that led me to choose egui over it. I still use imgui in my own projects for debugging though! Also, i didnt know about hello_imgui, where you can make standalone imgui apps. Thats definitely something to check out if you dont want to work with rust

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

    Tauri is very good :>
    (but its HTML, CSS, JS in frontend Rust in backend)

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

    Cargo run:
    Vroooooom

  • @chudchadanstud
    @chudchadanstud 8 หลายเดือนก่อน +1

    Gosh why is this so difficult to read?

  • @crossscar-dev
    @crossscar-dev 8 หลายเดือนก่อน

    what about dear imgui

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

    Why not just write your GUI in raylib or sdl?

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

      That can be quite a bit of work before getting an actual app running. I love raylib and SDL2, but writing a UI library from is very tedious. Raygui is pretty cool tho. I still prefer something like ImGui or egui.

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

      @@codingwithsphereit's a lot less work than learning Rust and fight with a compiler. After all C++ is kinda gamedev standard along side with C# that also have access to it. I kinda liked rust in a past, but in reality "Rust safety" is smaller variety than just "safety", you can write absolutely memory safe program that just don't have viable implementation in Rust. And also it's hard to create interesting program without unsafe Rust.
      Also i fall in love with "Textual" Python gui that is kinda CLI inspired. And you can use it for rapid app development and prototyping. And it kinda opened my eyes on GUI development, because it's so fast and easy, it's kinda a scaffolding development, you have so little personal value over things that you already implemented that you have almost zero cost for refactoring, removing and implementing new features in constant iteration. It's kinda like a creating a new way of thinking over process, and Rust will be hard.

  • @DaxSudo
    @DaxSudo 8 หลายเดือนก่อน +1

    Obligatory did u try Rust? Rewrite it in Rust.

  • @RenderingUser
    @RenderingUser 8 หลายเดือนก่อน +2

    no waaay a media converter. i made a cli tool for that with python.

  • @RuslanKovtun
    @RuslanKovtun 8 หลายเดือนก่อน +30

    egui is a "clone" of "imgui", not sure why you can't just use "imgui" which is C library.

    • @iglobrothers645
      @iglobrothers645 8 หลายเดือนก่อน +23

      The one is a C library meant for C / CPP. The other is rust native made specifically for rust using special rust features

    • @codingwithsphere
      @codingwithsphere  8 หลายเดือนก่อน +34

      I made this on egui because I enjoyed my experience making standalone applications with it more than I did with imgui.

    • @loganbries3867
      @loganbries3867 8 หลายเดือนก่อน +21

      Egui is not a clone. It doesn't use bindings to imgui, its written in pure rust. There are however bindings for imgui available under a different library.

    • @skejeton
      @skejeton 8 หลายเดือนก่อน +5

      egui has nothing to do with imgui aside from being immediate mode

    • @t-o-r-u-s
      @t-o-r-u-s 8 หลายเดือนก่อน +2

      You can’t use it if you are developing using, e.g, Bevy, which is a Rust framework for gamedev.

  • @cobollatin
    @cobollatin 8 หลายเดือนก่อน +1

    Wxwidgets?

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

    Funny enough the easiest way for a game developer to make a UI app might be... Godot

    • @Equisdeification
      @Equisdeification 8 หลายเดือนก่อน +2

      Aren't godot build sizes still a little bit too high for a small app? (Never tried godot)

  • @obkf-too
    @obkf-too 8 หลายเดือนก่อน +4

    Coming from the Python world, I can say this is way too complicated for a "simple" app, if you want simple a "desktop apps" use something like Tkinter and make the same App in less than 15mins (You can create the critical parts in Rust using Pyo3 like the image conversion logic if you wish).
    IMHO using high level programming languages for UI programming is the way to go, you reduce the development time and complexity of the code by a lot, and you still can optimize the critical parts using low-level languages like Rust, C, ... etc.
    You can use any high-level programming language and framework you want, as long as it is fast to develop, cross-platform and allows for easy low-level language interfacing.

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

      Yes, I have to say that Tkinter was on my mind the whole time I was watching the video, although I understand that he didn't want to relate to QT.
      I used CustomTkinter, btw. Maybe I'll try Flet next time.

    • @hermes6910
      @hermes6910 8 หลายเดือนก่อน +1

      You can also opt for Tauri or Wails and avoid Python where it shouldn't be used.

    • @codingwithsphere
      @codingwithsphere  8 หลายเดือนก่อน +2

      I have written a couple little apps with custom tkinter. I really enjoy it! I still prefer using immediate mode libraries, but I use both.

    • @codingwithsphere
      @codingwithsphere  8 หลายเดือนก่อน +1

      @@theyioel Flet is great

    • @deside1407
      @deside1407 8 หลายเดือนก่อน +1

      depends on task and acceptable complexity level, most of the time there is no reason to bloat app architecture

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

    *PromoSM*

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

    Oh it's cross platform, so it runs on ios, android, linux, mac and windows ? No? oh so it's not cross platform. Classic

    • @hermes6910
      @hermes6910 8 หลายเดือนก่อน +2

      Take a look at Tauri, with the V2 it's going to be very interesting even if still not perfect.

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

      You can run the same code for ui using different runtimes, or even just crosscompile it. Excluding mobile platforms of course(but theoretically this is possible). So it's totally cross-platform

    • @codingwithsphere
      @codingwithsphere  8 หลายเดือนก่อน +7

      It does though. Docs: "eframe is the official egui framework, which supports writing apps for Web, Linux, Mac, Windows, and Android." github.com/emilk/egui

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

      @@hermes6910 Tauri is awesome

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

      ​@@codingwithsphere Webapps are not crossplatform in the same way that native applications are tho... they rely on the web support for a certain platform, which means that your crossplatform webapp is not going to be even remotely comparable to a truly crossplatform native program. I thought you were aware of that after ditching electron, yet you claim that it has support for "writing apps for web", like bruh, that's not a solution to the problem.
      Btw, what about IOS? not that I plan to write for IOS, but that's what the comment mentioned and you decided to ignore it and mention that it has Android support, as if all mobile platforms were Android. Is Androind and Windows all there is to app development these days? I can sort of understand ditching Linux because Linux people are actually sane and prefer using CLI tools over terrible, slow and bloated UI "apps" (I miss the days when we called programs, well, programs), but come on, if we're going to claim to be crossplatform, at least make that claim true lmao.
      Anyways, as the OP said, classic.
      I'll be going back to C, where a bunch of ifdefs actually give me true crossplatform code that I can easily abstract through macros. Enjoy your almost crossplatform framework that relies on a web backend when there is no valid target (as per the description given in the github repo you linked yourself).
      Also, you seem to be confusing the difference between egui and eframe... they actually explain this in the repo you linked (quite ironic to link something that you yourself have not read through, and to top it all off, make a video about it without actually knowing what any of what you're using is or does)...
      "What is the difference between egui and eframe?
      egui is a 2D user interface library for laying out and interacting with buttons, sliders, etc. egui has no idea if it is running on the web or natively, and does not know how to collect input or show things on screen. That is the job of the integration or backend."