2 * This file is part of NumptyPhysics
3 * Copyright (C) 2008 Tim Edmonds
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 3 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
27 Canvas( int w
, int h
);
31 int makeColour( int c
) const;
32 int makeColour( int r
, int g
, int b
) const;
34 void setClip( int x
, int y
, int w
, int h
);
35 void setBackground( int c
);
36 void setBackground( Canvas
* bg
);
38 void clear( const Rect
& r
);
39 void fade( const Rect
& r
);
40 Canvas
* scale( int factor
) const;
41 void scale( int w
, int h
);
42 void drawImage( Canvas
*canvas
, int x
, int y
);
43 void drawPixel( int x
, int y
, int c
);
44 int readPixel( int x
, int y
) const;
45 void drawLine( int x1
, int y1
, int x2
, int y2
, int c
);
46 void drawPath( const Path
& path
, int color
, bool thick
=false );
47 void drawRect( int x
, int y
, int w
, int h
, int c
, bool fill
=true );
48 void drawRect( const Rect
& r
, int c
, bool fill
=true );
49 int writeBMP( const char* filename
) const;
51 Canvas( State state
=NULL
);
58 class Window
: public Canvas
61 Window( int w
, int h
, const char* title
=NULL
, const char* winclass
=NULL
, bool fullscreen
=false );
62 void update( const Rect
& r
);
64 void setSubName( const char *sub
);
68 class Image
: public Canvas
71 Image( const char* file
, bool alpha
=false );