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 renderText(int x
, int y
, std::string text
, unsigned int colour
, unsigned int bgcolour
) { }
30 virtual void blitSurface(Surface
*src
, int x
, int y
, int w
, int h
) { }
31 virtual unsigned int getWidth() const { return 800; }
32 virtual unsigned int getHeight() const { return 600; }
33 virtual void renderDone() { }
36 class NullBackend
: public Backend
{
41 virtual void init() { }
42 virtual int networkInit() { return -1; }
43 virtual void shutdown() { }
45 virtual void resize(unsigned int width
, unsigned int height
) { }
47 virtual unsigned int ticks() { return 0; }
48 virtual bool pollEvent(SomeEvent
&e
) { return false; }
49 virtual void handleEvents() { }
50 virtual bool keyDown(int key
) { return false; }
52 virtual bool selfRender() { return false; }
53 virtual void requestRender() { }
55 virtual Surface
*getMainSurface() { return &surface
; }
56 virtual Surface
*newSurface(unsigned int width
, unsigned int height
) { return 0; }
57 virtual void freeSurface(Surface
*surf
) { }
59 virtual void setPalette(uint8
*data
) { }
60 virtual unsigned int textWidth(std::string text
) { return 0; }
61 virtual void delay(int msec
) { }