5 * Created by Alyssa Milburn on Fri Dec 15 2006.
6 * Copyright (c) 2006 Alyssa Milburn. All rights reserved.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
20 #ifndef _NULLBACKEND_H
21 #define _NULLBACKEND_H
25 class NullSurface
: public Surface
{
27 virtual void render(shared_ptr
<creaturesImage
> image
, unsigned int frame
, int x
, int y
, bool trans
= false, unsigned char transparency
= 0, bool mirror
= false, bool is_background
= false) { }
28 virtual void renderLine(int x1
, int y1
, int x2
, int y2
, unsigned int colour
) { }
29 virtual void blitSurface(Surface
*src
, int x
, int y
, int w
, int h
) { }
30 virtual unsigned int getWidth() const { return 800; }
31 virtual unsigned int getHeight() const { return 600; }
32 virtual void renderDone() { }
35 class NullBackend
: public Backend
{
40 virtual void init() { }
41 virtual int networkInit() { return -1; }
42 virtual void shutdown() { }
44 virtual void resize(unsigned int width
, unsigned int height
) { }
46 virtual unsigned int ticks() { return 0; }
47 virtual bool pollEvent(SomeEvent
&e
) { return false; }
48 virtual void handleEvents() { }
49 virtual bool keyDown(int key
) { return false; }
51 virtual bool selfRender() { return false; }
52 virtual void requestRender() { }
54 virtual Surface
*getMainSurface() { return &surface
; }
55 virtual Surface
*newSurface(unsigned int width
, unsigned int height
) { return 0; }
56 virtual void freeSurface(Surface
*surf
) { }
58 virtual void setPalette(uint8
*data
) { }
59 virtual void delay(int msec
) { }