Creating A GUI from scratch in c++ or assembly

user451498 picture user451498 · Jan 3, 2011 · Viewed 19k times · Source

I have had numerous bad experiences with GUI library

so I would like to know how to create a window from scratch in c++ I am not talking about win32, what I mean is basically create it myself without any external library

is there any way to maybe use a picture or something to create a window yes I know how hard this will be.

also I read somewhere that library could be made for c++ in assembly

is there a way to create a custom gui in assembly or c++

EDIT: I am aiming at just windows

PS: another reason I want to learn how to do this is because

I might want to actually create an OS. so I would want GUI with that...

Answer

templatetypedef picture templatetypedef · Jan 3, 2011

In order to create a window you'll need to interface with whatever windowing system is currently present on your operating system. This will either require system calls if the window manager runs in kernel space (as is the case in Windows) or some sort of interprocess communication for user space window managers (like X). To create the window from scratch, you'll need to read up on how these window managers work and what protocols they use. In the case of X, it shouldn't be too hard to find resources on how the protocol works. In the case of Windows, your only option might be to use the API, since the internals of the window manager are proprietary.