Saturday, September 3, 2011

CUI vs GUI




From the very beginning when one gets used to the programming aspects he is in a hurry to make something interesting like a game or puzzle. I remember my initial days when i used to program in C/C++, i was very keen to make a game. But then i was having knowledge of basic C, where i was bound to play with just some ASCII characters to make some animations. Just a black window with some white characters floating on it. That world was known as CUI(Character User Interface) where user can interact with the system only by typing something on screen. Then i used to think that probably windows OS and the games what i used to play those days (Tekken 3, IGI etc) were written in some other languages. The 3D button, the moving mouse and the swaying windows everything that windows offered was simply great and provided easy navigation too. This was probably a new world – a GUI(Graphical User Interface) world. When i got some hands on C graphics i thought now i have got that power. It was now easy for me to build some rectangles,circles etc. simple 2D graphics. But still the windows world was quite far ahead. To build a better interface every time it was needed to check which functions get called, like moving windows,maximizing windows, clicking an icon etc. This seemed nearly impossible with the traditional C graphics and the ways by which we used to program. The problem becomes even worse when we find that with so many loops polling to check system events were eating away a lot of memory. Then i realized that maybe the windows world(i.e. GUI) is quite different from traditional CUI world.

In previous DOS based programs it was the programmer’s responsibility to call necessary functions but with the advent of Windows the whole paradigm got changed. Now it was the OS which calls necessary functions as and when needed keeping the memory requirements intact. OS was responsible to call necessary functions whenever some event occurs like user presses some button or moves some window. Now user was free from polling for events and he just have to define what will happen when some events occur. And thus our whole programming paradigm shifted to event based programming. With the GDI library in windows now it was really easy to create windows, fonts, scrolls etc.. But the story doesn’t ends here.
With the need of visualizing things in real, 3D GUI was necessary and there comes the 3D Graphics which in windows is taken care by the DirectX library. With help of it programmer find himself on the top of world. It was easy to produce 3d effects and now the Gaming World was not too far. With Open Gl and DirectX the computer screen(a 2D screen) got a new Dimension i.e. 3D

Keep checking :)
Next post:: 3D – Thinking in a new dimension

No comments:

Post a Comment