Instructions for running the CMPS160 assignments from your home PC using Visual C++ 6.0 under Windows:

(If anyone has success getting things to work using other environments like cygwin/XFree86, Linux, or Mac, email me and I'll add those instructions.)

In most cases, you only need the binary downloads to run things, but the source downloads usually include example programs that are very useful for educational purposes.

You'll eventually need to know the file paths to where the .h and .lib files are located. I recommend creating a graphics subdirectory (e.g., C:\graphics) for these to keep things tidy.

Thanks to Jose Renteria for the info on setting up Visual C++ 6.0.

You'll need 4 things:

1. Xforms (GUI builder: http://world.std.com/~xforms/)

  • get the W32 version from ftp://ncmir.ucsd.edu/pub/xforms/NT/W32/. There are several windows ports of xforms, but this is the one to use with using Visual C++.
  • Download either the bxform-088.tgz (same as a tar.gz file) or the bxform-0881.zip file.
  • Open the ftp://ncmir.ucsd.edu/pub/xforms/NT/W32/Xlib folder and download minx11.zip.
  • Download and unpack all the archives to your C:\graphics directory.
  • Copy the forms.dll file to a directory in the system's path (e.g. C:\WINNT\system32).
  • Note that you'll be running the fdesign.exe in bxforms881-w32/DESIGN (not the one in minx11/usr/bin).
  • 2. X server (weirdx: http://www.jcraft.com/weirdx)

      Xforms requires an X server in order to display properly.  I recommend getting the weirdx X server, as it's free. In this instance, I recommend downloading the source rather than the binary version, because the source includes batch files for running weirdx and also includes the configuration file for it. Weirdx requires java to be installed on your machine.  If you don't already have it, go to http://java.sun.com/getjava/download.html.  Follow the instructions for installation.
      Configuring weirdx: Once you've verified that weirdx is working properly, close weirdx and oclock and modify the config file (misc/config/props) to enable it to run as a rootless window manager (i.e., x apps appear in their own windows rather than in the weirdx window). Test that weirdx is running as a rootless window manager: Now when you start weirdx, you won't see a gray window for X programs to run in.  Instead, when weirdx is running and you run an application like oclock.exe, oclock.exe will appear in its own window.  If this isn't the case, you probably modified the wrong props file (there are two in the distribution).  Make sure you're working on the one in misc/config.

    3. Graphics libraries (OpenGL, Glut)

  • OpenGL: If you're using Visual C++ 6.0, OpenGL comes with it, so there's nothing to worry about.
  • Glut: A windows port of glut can be obtained from Nate Robins (www.cs.utah.edu/~narobins/glut.html ).
  • Download and unpack it to your C:\graphics directory.
  • 4) A C or C++ compiler (Visual C++ 6.0)

    Configuring Visual C++ 6.0 Test your setup by creating a new project:
    Build and Execute

    NOTE: if you get errors like...
      Linking...
      MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _tolower already defined in
      LIBCD.lib(tolower.obj)
    Then
    A)Click Project->Settings
    B)click the C/C++ tab
    C)add /MD to the end of "ProjectOptions" and hit OK
    D)Build and Execute

    AND THAT SHOULD BE IT...

    Good luck!
     
     

    Alternative setups

    Be warned: these tend to be a bit more complicated, so I might not be much help if things go wrong.

    Some general advice for alternative setups is to build the examples that come with the packages.  If the examples aren't working, it's highly unlikely that the assignments will.
     

    FLTK instead of XForms

    I converted the code to use FLTK instead of XForms and discovered a bug in FLTK's support for handling keystrokes through glut.  If this doesn't scare you off, or you're just curious about FLTK, here are some hints on getting started with FLTK: A tutorial on fluid (fltk's version of fdesign) can be found on the docs at the fltk site http://www.fltk.org/doc-2.0/fluid.html#6_5 .  There are some hints on setting up fltk at http://www.cse.ucsc.edu/~pang/fltk/fltk.setup.  You can find some examples in http://www.cse.ucsc.edu/~pang/fltk also.

    Cygwin/XFree86

    Instead of using Visual C++ 6.0 and weirdx, you can try cygwin/XFree86. Cygwin is a very complete unix environment for your windows machine.  It has a console window with a shell prompt, gcc, and even an X server (XFree86) so you can skip steps 2 and 4 above if you take this route.  Beware that since it is a unix environment, setting it up can be a bit more complicated than the procedure I described above. Also note that though in theory this should work just fine, I haven't verified this personally.

    If you don't have access to the OpenGL implementation that comes with Visual C++ 6.0, you can try Mesa, a free OpenGLimplementation (www.mesa3d.org). I believe that cygwin also comes with OpenGL (Mesa?).