pmc/include/surface.h
author Markus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:49:12 +0200
changeset 43 cf8c1b5127b2
parent 42 83b8151b966d
child 45 7197576fedcf
permissions -rw-r--r--
vector.cc Testcase -> Eine Referenz ist günstiger bei Vektoren -> move ist ohne Referenz flexibler -> Es werden weniger Objekte erzeugt und dementsprechend auch wieder zerstört. committer: Markus Bröker <mbroeker@largo.homelinux.org>

/**
 * test/demos/pmc/include/surface.h
 * Copyright (C) 2008 Markus Broeker
 */

#ifndef SURFACE_H
#define SURFACE_H

#include <object.h>
#include <SDL/SDL.h>

class Surface:public Object {
  private:
    int width;
    int height;
    int depth;

    Uint32 color, red, black;
    SDL_Surface *screen;

  public:
    enum foregroundColor { BLACK, RED };
    Surface (int w, int h, int d);
   ~Surface ();

    int getWidth () {
        return width;
    };
    int getHeight () {
        return height;
    };

    void drawPixel (int x, int y);
    void drawLine (int x1, int y1, int x2, int y2);

    void flip ();
    void setColor (enum foregroundColor);
};
#endif