Introduction to Programming

The MAK Library


This is a library I created to help simplify the process of making your first graphical program. It is based on the popular OpenGL library.

If you wish to use this library at home, you will need to follow a few extra steps to get my library installed on your computer.

  1. Download libmak.a for Windows or Mac OS X.
  2. Place libmak.a in /usr/lib (also known as C:\cygwin\lib on PCs).
  3. Download mak.h.
  4. Place mak.h in /usr/include (also known as C:\cygwin\usr\include on PCs).
  5. Download Makefile.
  6. Make a copy of Makefile, and put it in the directory you're going to write your code in.
  7. Come up with a name of your project. For the sake of example, let's call it "happy".
  8. Edit the local copy of the Makefile, and replace "boing" with "happy" (or your project name) everywhere. There should be four "boing"s in the Makefile.
  9. Make a new file, called "happy.c" (or the name of your project plus .c)
  10. Write a simple program, with #include at the top, and a call to makInit() at the end of main.
  11. make
  12. Try running your program! :)

Using the Library

Okay, so the installation is complicated. But I've done that part for you on the computers at school. Using it should be a lot easier! :)

Here's a very simple example of a program using my library. It just starts up the library and draws a sphere in the middle of the screen.

#include <mak.h>

void frame(int f)
{
    makDrawSphere(0, 0, 0, 0.1);
}

int main(int argc, char *argv[])
{
    makInit(640, 480, &frame);

    return 0;
}

Next: MAK Reference

Previous: Avoid


Introduction to Programming

Home