pmc/include/surface.h
author Markus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:49:13 +0200
changeset 59 a7ba10b68915
parent 54 c064ce9f40f5
permissions -rw-r--r--
getpwnam_error.c: * The memory hole can be fixed with two different approaches 1) Change /etc/nsswitch.conf: passwd: compat to passwd: files 2) LD_PRELOAD=/lib/libnss_compat.so.2 valgrind ./getpwnam_error GLIBC loads libnss_compat on the fly and unloads it. Thanks to telexicon for reporting this... 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;
    int bpp;

    Uint32 color, red, green, blue, black;
    SDL_Surface *screen;

  public:
    enum foregroundColor { BLACK = 1, RED, GREEN, BLUE };

    Surface (int w, int h, int d);
    Surface (const Surface &) { /* Copy Constructor disabled */ };
    virtual ~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