Make a GUI Calculator in C like a real Chad
Vložit
- čas přidán 11. 05. 2024
- I'm gonna show you how to make a small & aesthetic calculator app in C
like a real chad. No QT, GTK or any other bloat required.
NOTE: If you're on arch, you can easily build leif (the UI library) from the aur: paru -S libleif.
Build cglm from source: github.com/recp/cglm?tab=read...
Build libclipboard from source: github.com/jtanx/libclipboard... - Věda a technologie
A GUI library? A real chad would directly write to the screen buffer in assembly instead!!!
real
using masm
that's the GIGACHAD way
You should check Handmade hero course ;)
He made that library himself and he is 15 years old
😂@@user-hn6hg7sg4v
Now I‘m a real chad
Oha. Wie viel Geld machst du mit deinen YT shorts. Reichts zum leben?
will be watching the entire thing later, love this stuff
Love this low level C programming with using native winapi function calls...This is what real programming is all about 😉
His C code + the cross platform libraries made it easy as py 😉
@@alternatingf42why have to reinvent the wheel every time you need to go to the store? That's what libraries are for. As long as they're written in C as well it still counts, lol
@@robinpage2730 for performance
"winapi functions calls"
uhhh ok. sureeee, windows.
@@robinpage2730because its fun
I was needing this thanks dude
Really great GIGACHAD
Are you going to extend it adding more operations? For example 2^2=4, 2^2^3=256?
You're a tsoding fan aren't you?
red circle live on twitch (hope that answers that)
@@cococry you are both really inspiring
Wanted to make a Tsoding comment as well. 😂 Love channels like these.
after Tsoding became quite viral, similar content started to appear. this makes me happy :)
Great video my dude! I wish you created the window and UI without the Library instead. I know its quite tidous but would have been very interesting to watch.
Any chance you can show your nvchad setup? Especially your LSP and completion. I like the way your documentation previews look!
haven't watch code so i will ask here did you use concept of stack postfix/evaluation method to make it ?
Love this!
Which gruvbox theme exactly, please?
Sorry I’m new to C programming, what does this mean?:
(vec2s){0, 0}
I don’t even understand the syntax. I didn’t know you could put these symbols together like this. Thanks
This syntax is used to instantiate a struct of the given type, for example vec2 in place.
Suppose i have the struct foo {
int a, b;
};
foo b = (foo){2, 3};
Would initialize a foo with a set to 2 and b set to 3.
The initialization of the members will be in order when you don’t explicitly state it (as in (foo){.a = 2, .b = 3}). For the (vec2s){0,0} example this would create a vec2 with x set to 0 and y set to 0 as vec2s is defined like this:
struct vec2s {
float x, y;
}
Hope that helped :)
sehr stark
Hi. Out of curiosity what font are you using?
Is this Windows compatible? Also nice Neovim setup
hey! what is the keyboard doyou use?
keep going mate
how to make this calc working without terminal
Opening the app only by clicking on the icon and at the same time does not open the terminal ??
I was expecting Raylib 😂
What is this IDE ? neovim??
yes i was waiting for the video bro ....(yes the same guy who asked about resources)
looks like i came too early (i cant seem to change the video quality it looks 240p)
"looks like i came too early"
Me too! There is nothing that tickles my pickle more than some C code.
where are ( ) and unary minus :) ? This is neat, should expand it to include a more robust expression evaluator
hey bro im having an issue with buffer overflow while running the app
A real chad would use the mmap() to map screen memory to a pointer and you'd mix and match bit depths until you get a viewable display!
hey which IDE do you use and how do you manage to have that intellisense with argument placeholders ? Thank you
It says RAGNARWM v1.4 in the titlebar
It looks like a neovim with Youcompleteme, or a similar plugin, and clangd in the background as an LSP server to give the definitions etc.
@@nicolasdenis7094 thats the wm. The editor is nvim. The LSP is probs lsp-zero
its nvim with something from LSP-Zero. I just reccomend using lsp zero though
good skills
I'm a beginner in GUI programming and I really want to start with this, So I just wanted to ask if there's anyway I could do this on Windows 11. (I've been getting issues while installing the dependencies) Thank you!! :)
His program is not compatible with Windows, you would need to use Arch Linux inside virtual machine or WSL.
What colorscheme are you using?
gruvbox
Cool
dose leif works on wayland, I'm using hyprland and i get some issuse like the window of calc excutble file dosn't go to floating mode and the scroll bar dosn't work;
the scrollbar not working should be fixed with the last commit. Did you clone the last commit already, if not, git pull and reinstall leif. Then it should work. For the floating mode, thats not an issue with leif, but with the windowing you setup. You can put glfwWindowHint(GLFW_FLOATING, GLFW_TRUE); before glfwCreateWindow.
oh if you mean the actual scrollbar being not clickable, yes that’s not implemented yet in leif. You can just scroll with your mousewheel
glfwWindowHint(GLFW_FLOATING, GLFW_TRUE); dosn't work! why? @@cococry
are you using wayland by the way ?@@cococry
Have you uploaded the code for this calculator on github? so soydevs like me can read it in it's glory and learn from it?
yeah bro here: github.com/cococry/ticalc
Wanna know if this code works on Windows 11 ?? I am just a beginner in GUI programming and I hope to mimic to produce one with imaginary number operations. Thank you !
the code does not depend on unix only libraries so it should technically run but you would have to manually compile the leif library to a .lib file so that would be a bit of a challenge
@@cococry it shouldn't be impossible with mingw
❤❤❤❤
Yoo can you drop the nvim config files?
Hey bro , which os are u using , please tell and also how to make the terminal look like urs
im using arch and to make the terminal look like that, install alacritty, and install neovim with nvchad
@@cococry what windowing system are you using? is it wayland based?
@@unnamed1479 ragnar is currently written with xlib (xorg based) but there is a wayland branch under construction.
@@cococry thanks, haven't heard of it. gonna have to check it out.
@@cococry woah, you wrote this too!
noice
Can you make a video about your nvim setup?
no, its just nvchad
May I ask you some contact info? I'd like to ask a couple of questions regarding leif.
my email: cococry.btw@gmail.com
What editor are you using?
He is using neovim
@@_KondoIsami_ Thank you 😊
a seemingly nice configuration of neovim. the (pen)ultimate editor if u take the time to learn it (maybe behind emacs idk)
What’s the IDE called used for coding?
neovim
Can you share your nvim setup
same here. wondering which plugin he uses to make the command line window below permanently showing in vim/nvim. Or is it via a WM/tmux ?
@@saibakho im just using nvchad. its a neovim configuration
@@cococry From your advice i have found bufterm.nvim, which is exactly what i need. Thanks a lot !!
write the machine code entirely in a hex editor like a real sigma.
is there any way possible leif would work on win?
win support will be added soon
@@cococry k thanks!
im on 12:41, so the scrollbar is showing and can scroll but the text is not, even without for loop it's still not showing text
outside the scope, lf_text just works fine
ah, just add text_color to props and it works
Can you share your DE and WM configuration or make a video to set it up like that?
Oh nvm i found a video you made already, thanks
Which IDE are u using?
nvim + nvchad
@@cococry thanks
Didn't know python had a C skin
Make a GUI Calculator in C purely on standard VGA drivers 💀💀💀
writing this in Notepad++ and I can't check whether it will work.
are you on linux? and do you have a c compiler?
@@cococry the answer to both questions is no. office machine on windows
@@loo2003 okay, so you could try installing mingw-w64 and compile leif with that compiler. (you would have to write a manual build script and manually build dependencies)
then you need to get glfw include folder and glfw prebuilt binaries. then link leif and glfw to your calculator c file and compile that.
that should work, but it requires pretty advanced knowledge.
on linux, you can just follow the tutorial.
What font?, so preetty
In the terminal its lilex nerd font and on the bar its victor mono bold italic :)
@@cococry What IDE? Neovim or vim?
what happens when 0/0
Psst…
i don't think chard going to be making calculator programs
I would like to inform you that I am in fact not a Chad. Thank you.
tschmod
that is halaand voice
Kinda off topic but is that Emacs?
No, its nvim with nvchad
These people can't do hard coding . Such simple programming with heavy loads of external library . Can even code there own gui😂😂
Jesus Christ you’re a god