pmc/include/surface.h
author Markus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:49:13 +0200
changeset 57 7739518acafb
parent 54 c064ce9f40f5
permissions -rw-r--r--
duff.c: * Large String support added * parameter num renamed to len committer: Markus Bröker <mbroeker@largo.homelinux.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     1
/**
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     2
 * test/demos/pmc/include/surface.h
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     3
 * Copyright (C) 2008 Markus Broeker
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     4
 */
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     5
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     6
#ifndef SURFACE_H
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     7
#define SURFACE_H
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     8
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     9
#include <object.h>
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    10
#include <SDL/SDL.h>
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    11
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    12
class Surface:public Object {
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    13
  private:
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    14
    int width;
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    15
    int height;
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    16
    int depth;
46
4b9e1ac40246 pmc: Screen Depth Fix: Paint on 8, 16 and 32 bpp
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 45
diff changeset
    17
    int bpp;
42
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    18
46
4b9e1ac40246 pmc: Screen Depth Fix: Paint on 8, 16 and 32 bpp
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 45
diff changeset
    19
    Uint32 color, red, green, blue, black;
42
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    20
    SDL_Surface *screen;
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    21
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    22
  public:
54
c064ce9f40f5 Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 46
diff changeset
    23
    enum foregroundColor { BLACK = 1, RED, GREEN, BLUE };
42
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    24
54
c064ce9f40f5 Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 46
diff changeset
    25
    Surface (int w, int h, int d);
c064ce9f40f5 Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 46
diff changeset
    26
    Surface (const Surface &) { /* Copy Constructor disabled */ };
c064ce9f40f5 Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 46
diff changeset
    27
    virtual ~Surface ();
45
7197576fedcf pmc: namespace algebra for vector
Emilio Largo <largo@largo.homelinux.org>
parents: 42
diff changeset
    28
54
c064ce9f40f5 Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 46
diff changeset
    29
    int getWidth () { return width; };
c064ce9f40f5 Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 46
diff changeset
    30
    int getHeight () { return height; };
42
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    31
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    32
    void drawPixel (int x, int y);
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    33
    void drawLine (int x1, int y1, int x2, int y2);
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    34
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    35
    void flip ();
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    36
    void setColor (enum foregroundColor);
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    37
};
83b8151b966d Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    38
#endif