2
* Copyright (C) 2002,2003,2004,2005 Daniel Heck
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc.,
16
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18
* $Id: video.hh,v 1.9 2004/03/21 17:31:47 dheck Exp $
21
#ifndef VIDEO_HH_INCLUDED
22
#define VIDEO_HH_INCLUDED
26
#include "px/pxfwd.hh"
42
int width, height; // Screen width and height in pixels
43
int tile_size; // Tile size in pixels
44
const char *name; // Menu text
45
const char *initscript; // Lua initialization script
46
const char *gfxdir; // Directory that contains the graphics
47
int thumbw, thumbh; // Width and height of thumbnails
48
const char *thumbsdir; // Directory that contains the thumbnails
50
px::Rect statusbararea;
52
px::Rect sb_movesarea;
55
VideoModes fallback_videomode;
56
bool available; // Is this video mode available?
62
void ChangeVideoMode();
63
bool SetFullscreen(bool onoff);
65
/*! Switch between windowed and fullscreen mode. Return true if
66
fullscreen mode is active afterwards. */
67
bool ToggleFullscreen();
71
/*! Return information about arbitrary video mode. */
72
const VMInfo *GetInfo (VideoModes vm);
74
/*! Return information about current video mode. */
75
const VMInfo *GetInfo ();
77
bool ModeAvailable (VideoModes vm);
79
//! Return the current video mode
80
VideoModes GetVideoMode();
82
/*! Return the number of bits per pixel in the current video
83
mode. [currently always 16] */
86
px::Screen *GetScreen();
88
/*! The backbuffer is surface that has the same size and pixel
89
format as the screen. This surface is used by ShowScreen() and
90
FX_* functions below. */
91
px::Surface *BackBuffer();
93
/*! Update gamma correction using current options. */
96
void SetCaption (const char *str);
97
const std::string& GetCaption();
99
/*! Take a screenshot and save it as a PNG to file FNAME. */
100
void Screenshot (const std::string &fname);
102
/* -------------------- Input grabbing -------------------- */
104
class TempInputGrab {
106
TempInputGrab (bool onoff);
113
bool SetInputGrab (bool onoff);
115
/* -------------------- Mouse cursor -------------------- */
117
void SetMouseCursor(px::Surface *s, int hotx, int hoty);
123
/* -------------------- Visual effects -------------------- */
125
class TransitionEffect {
127
virtual ~TransitionEffect() {}
128
virtual void tick (double dtime) = 0;
129
virtual bool finished() const = 0;
132
enum FadeMode { FADEIN, FADEOUT };
133
void FX_Fade (FadeMode mode);
134
void FX_Fly (px::Surface *newscr, int originx, int originy);
141
TM_FLY_N, TM_FLY_S, TM_FLY_W, TM_FLY_E,
142
TM_FLY_NW, TM_FLY_NE, TM_FLY_SE, TM_FLY_SW,
143
TM_PUSH_RANDOM, TM_PUSH_N, TM_PUSH_S, TM_PUSH_W, TM_PUSH_E
145
void ShowScreen (TransitionModes tm, px::Surface *newscr);
147
TransitionEffect *MakeEffect (TransitionModes tm, px::Surface *newscr);