I made my own UI library in C++, How to design a complicated system?

  Рет қаралды 24,451

Low Level Game Dev

Low Level Game Dev

10 ай бұрын

Join my Discord:
/ discord
Wishlist Midnight Arrow on Steam:
store.steampowered.com/app/23...
Join this channel if you want to support me 😻:
/ @lowlevelgamedev9330
Check out Pika Engine, where Sushi is also at the moment:
• So I Made My Own Game ...
Glui: github.com/meemknight/glui
Music: Evan King - Virtually Impossible
Music: Evan King - Booty Shake Robot
Music: Evan King - Spicy Boom
/ contextsensitive
contextsensitive.bandcamp.com/

Пікірлер: 77
@HalfAsleepSam
@HalfAsleepSam 9 күн бұрын
I, too want me to learn this stuff but it just passes through me like radio waves.
@kgola3569
@kgola3569 10 ай бұрын
Bro, I love your videos!
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
thank youu 💪
@AgnisNeZvers
@AgnisNeZvers 10 ай бұрын
My solution for submenus is statemachine. Represent each state with a number. Or routine of each layout is abstracted into function and those functions used as a state.
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
yeah well a sumbenu is a state machine, sounds nice💪 I use a stack for my state machine (each menu has an id pushed om the stack)
@AgnisNeZvers
@AgnisNeZvers 10 ай бұрын
@@lowlevelgamedev9330 If you want to torture yourself - add features like menu transition and UI element state transitions (hover/pressed).
@plabankumarmondal
@plabankumarmondal 10 ай бұрын
I learned C++ in uni but I really hate build tools(eg CMake) in C++ ecosystem and that's the main reason I never got into creating projects with C++
@lucy-pero
@lucy-pero 10 ай бұрын
i know it looks like that from the outside but it's not really an issue. You have so many choices on how to build your program and it can be as simple and as complex as you want. some people just write a short .bat file to build the whole thing. You could just write a small c++ program that builds the real program. Or just use premake, it's pretty good and simple. It can output a visual studio solution, or a Ninja file, which makes a super fast and simple build.
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
totally agree with you and that is way I have a few videos with cmake on my channel. The one called make your first c++ game now just explains how my cmake setup works so you never have to deal with it again. Maybe it helps I configured it as sane as possible
@aksakalaradhita
@aksakalaradhita 10 ай бұрын
There are easier alternative build system like premake, ninja, or scons. So you can avoid Cmake
@TinyGhost42
@TinyGhost42 5 күн бұрын
honestly, same. Add to that where i was using the new M1 chip at the time and it made it even more confusing for me.
@anonimowelwiatko4455
@anonimowelwiatko4455 10 ай бұрын
Your code is interesting. I used to code in similar fashion while working at my first job. Now I kinda lean more into Clean Code approach. Both have their own pros and cons. I also started digging into CMake lately. It's not this hard actually, I might get grasp of it. I made once my GUI but it was very newbie approach. I want to take on this task soon and see how much I improved, adding layers of abstraction and making more scalable, easier to read and work with approach. I respect work you did and knowledge, passion and skills you are sharing with others. Definitely one of those types who like to write my own tools and use them. I think it's common between C++ programmers. Do you unit test what you write? Also, you made a lot of projects but do you plan on making something bigger, have your own purpose or you just enjoy process of making stuff and prototyping?
@BasPower12
@BasPower12 6 ай бұрын
I'm a C++ learner. I barely have a tenth of the experience you have. I'm inspired and want to build by own build tools like you once I become a C++ game dev
@MahdiyDev
@MahdiyDev 10 ай бұрын
Amazing video
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
thanks 💪💪
@that404nerd
@that404nerd 10 ай бұрын
Yo i hope u make a video about a grouping system or layer system for a game engine. Btw this video is amazing yo
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
hm that would be a good idea thanks 💪💪
@that404nerd
@that404nerd 10 ай бұрын
​@@lowlevelgamedev9330thanks for the reply man!
@PaulMetalhero
@PaulMetalhero 10 ай бұрын
Very nice work! Question: how do you implement scrolling inside a gui window? is it just a view matrix? I use OpenGL
@lowlevelgamedev9330
@lowlevelgamedev9330 9 ай бұрын
well what you saw there uses imgui so it was not done by me but when Ill do my own scrolling I use my own 2D library tjat just does the computations by hand on the cpu. I don't recommand it tho not becaise of performance (it is totally fain on performance) but because it is harder to code and read than using matrixes
@PaulMetalhero
@PaulMetalhero 9 ай бұрын
Thanks@@lowlevelgamedev9330
@felipelopes3171
@felipelopes3171 10 ай бұрын
As someone with experience in UI programming (I wrote a desktop UI app from scratch), I think this video has several misconceptions and is a disservice to the community. Don't get me wrong, if you want to write your own UI library, go ahead and do it, but it's another thing when you don't report accurately why you're doing it and leading others to error. (1) in web development, visual editors are used all the time, not by the front-end developers, but by the UX designers. Although you can define everything in code, it's usually too tedious to do so, and there's pretty much no way you can compete with a skilled designer using visual tools just by writing code. For desktop apps, there are a lot of RAD tools where you can design the UI yourself and just by inheriting from the generated class you can do everything, and it's orders of magnitude faster. (2) the fact that UI libraries are event driven/use callbacks has nothing at all to do with visual editors. Even if you write everything using code, you still need to understand them. That's because every modern UI library (and by modern I mean after Windows 95 and the Unix OSes in the 80's) uses a display server as a backend, and only this display server knows when a user has performed some action. (3) what distinguishes immediate mode UI libraries from retained ones is not that it has a declarative hierarchy for its elements (every UI library has this). Immediate mode UI allows you greater control over the rendering process, while retained ones keep everything separate. That's why you use Dear ImGUI for games, where you want to overlay the UI on top of a scene, whereas if you use a retained library like Qt or wxWidgets, they don't have that functionality, the best they can do is give you a canvas where you can draw stuff using OpenGL or equivalent. (4) you did not even mention how every UI library solves the layout responsiveness problem. they have the concept of sizers, which can take a variable amount of space depending on the screen size, solving exactly the issues you explained in the video. Like I said, it's OK to write your own UI library, but if you do so, make sure to study beforehand what's already been done so that you actually code something useful...
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
Thanks for the feedback. I expected to get some feedback like this and I agree with you but I wanted to keep things simple so I ended up not mentioning some things.
@felipelopes3171
@felipelopes3171 6 ай бұрын
@@rytif Thanks for your thought provoking comment. I did not attempt at all to hide the fact that I develop for web and enterprise, and it's indeed obvious from my comment. That doesn't change the content, though. This video has serious errors. I am not a game dev, and I also don't make videos saying how I'm developing an engine that's much better than what gamedevs use, because I know it takes a lot of work. That's not to say that gamedevs cannot make comments about other industries, as long as they are correct, of course. You need to have responsibility of what you publish, and that's not exclusive to software development, by the way.
@AE4i1
@AE4i1 10 ай бұрын
Well well well
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
well well well
@rmt3589
@rmt3589 10 ай бұрын
Wait, you can use CSS for a game engine's UI!? I mean, I've heard of Unity CSS, but never considered CSS was an option for me. Would be amazing!!! Hopefully I can find a tutorial, and if not, hopefully Phind can help me.
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
yes and there are some ui intensive games that do that because they can more easily find people to work on their ui but please don't do it 😂😂. You are bringing a bigger echosystem than your entire game just to make some simple UI and now what was suppsed to be the simplest system becomes the most taxing and it slows down your game 😂😂
@rmt3589
@rmt3589 10 ай бұрын
@@lowlevelgamedev9330 But... I'm already fluent in HTML and CSS... T^T
@siniarskimar
@siniarskimar 10 ай бұрын
This kind of solution is more common in non-game user interfaces (for example GTK), where a subset of CSS is implemented. *Be warned*, just because you can, doesn't mean you should.
@BasPower12
@BasPower12 6 ай бұрын
I'm inspired and also wanna create my own C++ game engine
@CheeseOfMasters
@CheeseOfMasters 10 ай бұрын
Just finding my way into the gui space to create a small text-based adventure game, this is a very good introduction!
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
nice, I'm glad it helped 💪 the best advice I can give you is to make a good structured code and fix all of the things because UI is quite difficult and annoying and this will help you
@unethicql
@unethicql 10 ай бұрын
Damn, its like 4 minutes, but my brain is overheated already.
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
😂😂
@elenamariam5275
@elenamariam5275 10 ай бұрын
Sushiiiii ❤❤❤
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
yesss
@EnLopXf
@EnLopXf 10 ай бұрын
New subscriber more video tutorials about WinApi thank you
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
yes they are on their way 💪💪
@oh-facts
@oh-facts 10 ай бұрын
is this ui library meant for in game UI or debug/editor UI?
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
game ui, for debug editor UI ImGui is the way to go
@astrahcat1212
@astrahcat1212 9 ай бұрын
You don't like callbacks either!! Yessss thank you!! 🤔🤔🤔🤔🤔🤔 What you can do for creating animated UI, is use shaders for transitions and smooth animations, as of course you don't have any animator with keyframes and that would take forever and be useless to make for an individual project.
@lowlevelgamedev9330
@lowlevelgamedev9330 9 ай бұрын
hm for animations I think I will premake some primitives to allow you to just move elements, I recomand to do the calculations on the cpu for simplicity and flexibility, there is no need to make them on the gpu, ill see when I get there thanks 💪💪💪💪
@astrahcat1212
@astrahcat1212 9 ай бұрын
@@lowlevelgamedev9330Well, GPU is faster and because then you can use all kinds of free MIT licensed effects from ShaderToy and elsewhere online. It's all in GLSL only unfortunately though, so gotta re-write it.
@ulrich-tonmoy
@ulrich-tonmoy 10 ай бұрын
Will you make any game engine or ui library in Zig
@CheeseOfMasters
@CheeseOfMasters 10 ай бұрын
zig-gamedev has dear imgui bindings in a library called zgui. It's pretty easy to use with imgui c++ tutorials.
@seanomik6176
@seanomik6176 10 ай бұрын
You can do this in zig as well as long as it has an opengl (or other API) wrapper
@ulrich-tonmoy
@ulrich-tonmoy 10 ай бұрын
@@seanomik6176 you dont need that you can also code platform specific what i mean is a tutorial to learn theres not much good Documentation to learn
@seanomik6176
@seanomik6176 10 ай бұрын
@@ulrich-tonmoy you can try learning it in c++ first. It would help understand what you need to do to render in zig. That's what I did when I moved from c++ to rust.
@ulrich-tonmoy
@ulrich-tonmoy 10 ай бұрын
​@@seanomik6176 i m already building a game engine with c++ and learning c++ wont help cause zig gives the lowest level of control to users so theres not much in the standard lib like we have in c++ we have to code them ourselves yep Rust is like better C++ while Zig is like better C that gives you even lower hardware control but for game dev C/C++ still king and Zig might be added to the list cause you can use C/C++ interchangeably and also use zig as cross platform build system.
@edhahaz
@edhahaz 7 ай бұрын
The HTML code is just layout, that could easily be made in a visual tool, so no, I don't think you can draw the conclusion that a visual tool is worse from that.
@bloodaid
@bloodaid 3 ай бұрын
What someone needs to do is to create a GPU accelerated GUI library that accepts CSS styling for all the elements.
@madeso
@madeso 7 ай бұрын
There aren't more gui libraries than there are engines. The reason there are "many" is because there are many languages and platforms. You also showed bootstrap, bootstrap is a component library not a gui library.
@lustydough
@lustydough 10 ай бұрын
ayoyoyoyo
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
yoyoyo
@linksword7110
@linksword7110 10 ай бұрын
Amongus
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
amogus 🗿
@GentleMannOfHats
@GentleMannOfHats 10 ай бұрын
very cool. If only I understood C++
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
you could always start learning it
@GentleMannOfHats
@GentleMannOfHats 10 ай бұрын
@@lowlevelgamedev9330 I've been intrested in learning. I have wanted to try homebrewing games and C is one of the few options as the code ran on bare metal haha.
@Slowxvibes
@Slowxvibes 10 ай бұрын
amogus
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
amogus
@korigamik
@korigamik 10 ай бұрын
Oh fuck that ting notification sound. You made me deaf🤬🤬
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
sorry about that 😅😅
@RuedigaTheSecond
@RuedigaTheSecond 10 ай бұрын
Yooo
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
yoooo
@yuvu11hjg
@yuvu11hjg Ай бұрын
Amog us
@lowlevelgamedev9330
@lowlevelgamedev9330 Ай бұрын
good, good
@watchcrap1
@watchcrap1 10 ай бұрын
Bootstrap in 2023 😂
@lowlevelgamedev9330
@lowlevelgamedev9330 10 ай бұрын
I am not a web dev I don't know what is used there right now 😂😂😂 so take it only as an example
@andikasujanadi
@andikasujanadi 10 ай бұрын
I left tailwind for bootstrap in 2023, what's wrong with it?
9 DEVS Make a GAME without COMMUNICATING (Where did it go Wrong?)
21:33
Blackthornprod
Рет қаралды 1,2 МЛН
4 Months of Game Programming With My Own Engine
21:30
jdh
Рет қаралды 425 М.
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 11 МЛН
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 10 МЛН
My 10 YEAR Indie Game Development Journey
23:58
ThinMatrix
Рет қаралды 558 М.
All OpenGL Effects!
30:21
Low Level Game Dev
Рет қаралды 58 М.
One year of my C++ SFML journey
5:39
Snapi
Рет қаралды 409 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,5 МЛН
6 DEVS Make a GAME without COMMUNICATING! (HARDCORE edition)
20:12
Blackthornprod
Рет қаралды 1,7 МЛН
Coding Adventure: Simulating Fluids
47:52
Sebastian Lague
Рет қаралды 1,7 МЛН
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,4 МЛН
My First Year Learning Coding and Game Dev | GODOT DEVLOG
12:39
New Graphics Library in C (Olive.c Ep.01)
1:58:46
Tsoding Daily
Рет қаралды 137 М.