Window Creation in Beef Language

314 views Asked by At

So recently I have been learning about compilers and llvm and all of that kinda stuff. But what is really bugging me, is Beef. Beef is a cool programming language that I just learned existed but it is like C# Pro. But the one part I don’t understand is the window creation. Beef uses SDL which I get. (I have no idea how it links it) You can just create (on MacOS) an NSWindow and tada. But that is only supported in objective-c(++). So how on earth is beef able to do something like that?

1

There are 1 answers

1
Ruzihm On

In the constructor of the WinBFWindow class in WinBFApp.cpp, Beef calls CreateWindowExW function of the Win32 API to create a window.

Whenever BFWindow.Init is called in beef, that is what eventually gets to that Win32 API call.