- 1
- 136 171
Muukid
Приєднався 27 кві 2023
linktr.ee/muukid
Creating a window - Software from Scratch
Chapters:
0:00 - Intro
2:26 - The C Programming Language
11:01 - muCOSA and Win32
16:24 - Setting muCOSA up (the technical part)
26:32 - THE WINDOW
37:34 - Basic window attributes
45:00 - Window input
1:02:58 - Wrapping things up
0:00 - Intro
2:26 - The C Programming Language
11:01 - muCOSA and Win32
16:24 - Setting muCOSA up (the technical part)
26:32 - THE WINDOW
37:34 - Basic window attributes
45:00 - Window input
1:02:58 - Wrapping things up
Переглядів: 136 573
impressive work. nice edition. just want to said 34:11 that "mucosa" is a mucous membrane.
i really like the color palette in the code snippets, what's the theme's name?
now implement system calls 🔫
You should be able to use ClientToScreen to get the position in monitor/screen space. Nice video 👍
15:15 WSL (Windows Subsystem for Linux) is a great way to run Linux on Windows. You can remote connect to it through VSCode and probably even other IDEs. So that way you can record your screen and code for Linux at the same time!
Why didn't you just use wsl for the linux side of things?
When your wrapper code needs wrapper code of its own, you have achieved greatness.
ENOUGH. muCosa? Like mucus? Dude you need to check your acronym game.
I love that you said "don't worry if you don't know what that means" in the one place in this overal esoteric video where I actually experienced that thing irl.
This dude over here preparing to be sent back in time
you did not need to do the whole global window context finding stuff. SetWindowLongPtr and GetWindowLongPtr with the argument GWLP_USERDATA let you associate a pointer to whatever you want with the window handle
Muukid starts by recommending overloading functions etc. with macros (#define) which is certainly not recommended practice now and leads to code that is very difficult to maintain and debug. If you want to be able to do this kind of overloading, it's probably better to start with C++ rather than C. The next chapter craps all over the Win32 API. I am serious, you will not find it more logical and better documented OS API in this universe. Yes, it has many functions, and yes, sometimes there are several ways to do the same thing with only subtle differences between them. But this is the sign that you are dealing with a mature and rich system rather than one that's been cobbled together ad hoc by people who barely knew what they were doing. You also have many recent options for writing on top of this API if it's too hard for you. The rest of the video, as far as I can tell, consists of Muukid recreating a bunch of stuff that's already in the Windows API. Proof that he did not give any serious consideration or study to it. Overall, it is a very poor video that exposes the relative inexperience of the author.
Good video
11:32 talk tuah
Fun fact, in spanish the word "cosa" means "thing/object." Not sure if anyone has mentioned that yet, just thought it was kind of funny.
Fun!
4:40 u literally created a tool called "мудак", which translates as "asshole"
Whats wrong with memset dude?
you must be aware of type theory and maybe even homotopy type theory? I'm kind of confused how magically dependent types, and specifically this "global context" appeared .. very cool
49:05 Hey, doesn't a window have a user pointer that you can assign to your window management object? Last param of CreateWindowEx is LPVOID lpParam . You get that pointer in WindowProc lParam. You don't need a map. You can have an object or structure that you can attach to a window
49:50 instead of LUT you could try using "container_of" macro from linux kernel. Thats a clever macro for pointer manipulation that results in getting the parent struct.
Great stuff. But beware implementing your own spinlock. You used a volatile variable and that does not mean that CPU caches are written through. Additionally you also need to use atomic compare and exchange operations to make sure that two threads can't read that the lock is unlocked and grabbing it at the same time. But other than that this is a very fun project.
How are you testing all this?
the keymap is exactly the same as in sdl
Exactly what I wanted for months
Wait, do you make the music too??
19:34 doesnt that sound like opengl? :))))
Fun fact. I wished in the past few months to achive this. but left it later. THx for showing your path.
Commenting for the algorithm
You kept describing C as close to machine language. I'm no programmer, but what differentiates it from Assembly?
excellent. excited to see where you take it. looking forward to watching you cope with posix.1 and wayland/x11 next year :)
Love how GetClipboardData(some*) returns a handle but CloseClipboard(void) 😂 like u said win32 api sucks 😂
7:10 good alignment 😍👍
Please continue man 😭
31:50 ey yo, I got a question. I'm a bit new to C programing so forgive the ignorance....but how is this Window class supposed to be used and/or implemented in this C program? Last I checked, C doesn't support Classes or any OOP patterns. That's what C++ is for. Does the official doc assume you're just using C++ by default or can we make something like a class in C using structs? And even if we do that in C, will we also have to create our own Inheritance and Polymorphism and all the rest of the OO stuff just to get this "Window" class working?
altho i have made windows programs using python using gui libraries, but i really want to sometime spend time on learning and trying low level coding from scratch to actually understand stuff
Holy shit!!! 🔥🔥🔥
Couple of notes, first off, SAUCE?! where's the github!? I want to play with muCOSA on the linux side of things. Second off, love the video. Keep it going! Lastly, I had a video idea. Pick a laptop model, a specific model and lets build a from scratch GUI/OS for THAT specific hardware. I think that would be awesome. I love ben eater videos too, I wish he made content more often, fill my need for low level programming.
Using void inner seems like an extra dereference, bad caching. Maybe an union would have been better idk. (And a type enum?) Though you are a much better C dev then me. I know fuckall about macros.
holy crap 1:31 had me dying
Bruh, I expected interfacing with X in assembly not just the win32 api. This stuff is super easy. I've done that exact setup dozens of times and never tried to pass it off as an achievement.
My only problem with this video is that part 2 isn't out yet....
It's not a real window. (Delphi is better).
This tutorial is A++ in addressing C, C+?, C++? and technology in general. Not my strength, but your outstanding communication and organized, creative teaching method awoke my interest and made it seem possible that I too could learn something new and expand my world to more than just opening e-mails, texting and scrolling. Your passion fuels my interest. Need to learn more and awaiting the next chapters. Continuing one chapter at a time is a great help.
Is it one of those legendary UA-cam algorithm encounters where we come across some highly valuable stuff.
First time I see a video in 5:4 aspect ratio. Really neat.
I'm stealing your pfp
At this point you can just code your own os 😂😂😂😂
1st. Insanely good video to watch before bed. 2nd. You missed the opportunity for a "These bitches love COSA" joke 3rd. Amazing algorithm pull, have subscribed, will be looking forward to the next video
banger video, keeping me entertained by mostly a black screen and a voice is not an easy task, let alone doing so for over an hour