View Single Post
Old 06-28-2003, 05:34 PM   #3 (permalink)
devin
Registered User
 
Join Date: Mar 2003
Location: California
Posts: 9
devin is on a distinguished road
Send a message via ICQ to devin
Well I would suggest taking a look at open source stuff that already works.. Like the X11 souce code. Many people hate X11 but it does work.. It is really large but you will want to limit your review of the code to probably the way events are handled.

How does the window system interpret a left mouse click, or a right mouse click (actually I think X11 passes this functionality onto window managers) ? You may want to take a look at some of the more minimalist window managers (evilwm, aewm, or even WindowLab). aewm is very well commented.

For drawing a GUI you will need to copy pixel data (is it on, and what color is it) onto the video memory. You can use a low level library (Allegro works on DOS and Linux) for drawing windows and lines. Or you could always write your own routines that will copy picture data onto video memory. There are several different ways to do this depending on the operating system. Some older DOS C, and C++ grahic programming books will explain how to do this. Try to avoid the Borland ones since they often rely on a high level driver called BGI (Borland Graphics Interface)

My school teaches Java to beginning CS majors, after your sophomore year you are usually allowed to program in C++ or Java. Some CS majors just end up writing C though in their C++ programs. Some teachers prefer Java and some prefer C++ but they will usually accept programs in either language.

By the way, if you do ever look into the source code of X11 or Allegro or some other lib/program, you need to be aware of the license.. If it is GPL, and you use code or routines from the software you are required to use the GPL as your license as well. (I'm pretty sure)
devin is offline   Reply With Quote