SDLInterface.h

Go to the documentation of this file.
00001 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 5 -*- */
00002 
00003 /*
00004  * Combination of a first person action and a real time strategy battle game.
00005  */
00006 
00007 /*
00008  * SDLInterface.h
00009  * MetalWarriors
00010  * $Revision: 1.8 $
00011  *
00012  * Created by Daniel Aarno on Sun Oct 12 2003.
00013  * Copyright (c) 2003 Daniel Aarno and Erik Ytterberg - All rights reserved.
00014  *
00015  *     This program is free software; you can redistribute it and/or modify
00016  *     it under the terms of the GNU General Public License as published by
00017  *     the Free Software Foundation; either version 2 of the License, or
00018  *     (at your option) any later version.
00019  *
00020  *     This program is distributed in the hope that it will be useful,
00021  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  *     GNU General Public License for more details.
00024  *
00025  *     You should have received a copy of the GNU General Public License
00026  *     along with this program; if not, write to the Free Software
00027  *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00028  */
00029 
00030 #include "Interface.h"
00031 
00033 class SDLInterface : public Interface
00034 {
00035 private:
00036      bool needsRepaint;
00037      bool full_screen;
00038 
00039 public:
00040      ~SDLInterface();
00041      virtual int start();
00042      
00043      virtual void flush();
00044      virtual void repaint();
00045      
00046      virtual void setIdleCallback(void (*func)(void));
00047      virtual void setPaintCallback(void (*func)(void));
00048      virtual void setKeyboardCallback(void (*func)(int key, int x, int y, 
00049                     bool special, bool down, unsigned int modifiers));
00050      virtual void setRawEventCallback(void (*func)(void *event));
00051      virtual void addTimerCallback(void (*func)(int value), int time_ms, 
00052                     int val);
00053      virtual void setWindowSize(int width, int height);
00054      virtual void setFullScreen(bool fullScreen);
00055      virtual bool getFullScreen(void) {return full_screen;}
00056      virtual void setMouseEventCallback(void (*func)(int x, int y, 
00057                     MouseButtonType button, bool down));
00058      virtual void setMouseMotionCallback(void (*func)(int x, int y));
00059      
00060      
00061      virtual int getTime();
00062      virtual int getWindowWidth();
00063      virtual int getWindowHeight();
00064      
00065      virtual const char* name() { return "GLUT"; }
00066 
00067 protected:     
00068      virtual int init(int argc, const char* argv[], int width, int height);
00069 };

Generated on Sun Mar 11 15:33:23 2007 for MetalWarriors by  doxygen 1.4.7