<- previous    index    next ->

Lecture 1


The purpose of this course is to provide the student both
knowledge and a basic Graphical User Interface, GUI, program
that the student has written and can be expanded into
various applications the student wants to develop.

Building GUI programs is non-trivial yet rewarding.
The student needs to understand the operating system,
the windowing system and "tool kits."

Course motto: If it works, use it.
              If not, find another way.

You will be dealing with windowing systems and graphical
libraries that are much larger and more complex than
operating systems. I guarantee they will have bugs.
Your grade depends of finding a way around any bugs.
Your program must work in spite of system/library bugs.

The basic prerequisite for this course is to be able to
write working code in some reasonable programming language.
You will probably be writing 1,000 to 10,000 lines of code
in this course. Don't panic. A lot of code is repetitive.

You are expected to know the software development cycle"

      Edit          <-----------+
           Compile              |
                   Run          |
                       Curse ---+

As an acknowledged expert, Edsger Dijkstra, has stated:
"Top down design and programming is right every time
except the first time." For your rapid learning you
do not want to use the "waterfall model" or even
Barry Boehm's "spiral model", but rather use 
"rapid prototyping".

Don't worry about the details, for a while, yet look over
the organization and structure of the same GUI application
written for X Windows Motif, OpenGL and Java.

You will need to make a choice of "platform" for doing
the programming for this course. My lectures will cover:

   Microsoft Windows - OpenGL in C, C++ (same code for Linux)
                     - Java             (same code every where)

   Linux, Unix       - OpenGL in C, C++ (same code  MS Windows)
                     - Java             (same code every where)
                     - X Windows Motif

      On Microsoft Windows you need Windows XP and Microsoft
      Visual Studio installed in order to use OpenGL.
      You will need OpenGL Utility Toolkit, GLUT, also.
      On Microsoft Windows you need Java 1.4.2 or later installed

      On Linux, Unix gnu compilers should be available. Install
      OpenGL (called Mesa) if not already available.
      You will need OpenGL Utility Toolkit, GLUT, also.
      On Linux, Unix you need Java 1.4.2 or later installed.
      On Linux, Unix you need Motif (called Lesstif or OpenMotif) installed.
      (UMBC linux.gl.umbc.edu has all software installed with the
       possible exception of GLUT)


GUI Human factors: Make sure it is obvious to the user of your
                   application how to quit, exit, kill or stop.


Just a quick look at some sample code.
See which will run on your development system

  w1.c basic X windows

  w1.jpg - screen

  w1gl.c - w1.c in OpenGL

  w1gl.jpg - screen

  W1frame.java - w1.c in Java

  W1frame.jpg - screen

  W1app.java - W1frame as an applet

Note that:
w1.c, the basic X Windows GUI application can be compiled
      and executed on all Unix based operating systems,
      including MacOS X

w1gl.c, the OpenGL GUI application can be compiled
        and executed on almost all operating systems
        that provide windowing (All forms of Unix,
        MacOS and Microsoft Windows, etc.)

W1frame.java, the Java GUI application can be compiled
              and run on any system that has Java
              J2SE 1.4.2 or later available.

W1app.java, the Java GUI application can be compiled
              on any system that has Java J2SE 1.4.2 or
              later available. Then run in almost any
              WEB browser. But, the user may not have
              Java applets enabled. There are also some
              severe restrictions on applets.

Other sample applications may include:
split_cube - visualization, color, movement, inside
teapots - lighting
planets - lighting and glowing 1
sky_fly - terrain
pilot - do your own flight simulator
springgl - education
spring2gl - build on previous
alpha_fade - scene transitions
earth - texture map pictures onto objects
gears4 - modeling
tenseggl - modeling
light_dat - skull, more modeling

draw - default object oriented graphics
pairs2 - game
hull_draw - modeling
mover - independent window control
fractal - create scenes (art vs composition)

Now, you need to set up your system for GUI programming.

linux.gl.umbc.edu has everything for Linux X Windows,
OpenGL and java. You may have to download software or
set up links or change directory names on your Linux
or Unix system.

Microsoft Windows needs to have Microsoft Visual Studio to
be able to compile programs for OpenGL. There are many
versions of Microsoft Visual Studio and thus they are
not covered in this course. The essential component is
"cl.exe" the C and C++ compiler that can be used from
a standard command prompt. If you use Visual Studio
be sure you turn off preference "precompiled header files".

More information is in getting started

That said, here are the Linux/Unix "Makefile" and the
Microsoft Windows "make.bat" files that compile and execute
the source code shown above.


  Makefile1.linux
  make1.bat

In my personal directory, I have some Makefiles and
some  make.bat's  that includes all commands to make
most programs in that directory. 
A start of my Makefile and make.bat is shown above.

An option to  make.bat is to use  nmake  on Microsoft Windows.
(This is an optional exercise for the student.)

    <- previous    index    next ->

Other links

Go to top