1 #pragma once 2 // Description: 3 // Video subsystem. 4 // 5 // Copyright (C) 2001 Frank Becker 6 // 7 // This program is free software; you can redistribute it and/or modify it under 8 // the terms of the GNU General Public License as published by the Free Software 9 // Foundation; either version 2 of the License, or (at your option) any later 10 // version. 11 // 12 // This program is distributed in the hope that it will be useful, but WITHOUT 13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details 15 // 16 #include <string> 17 18 #include <GLTexture.hpp> 19 #include <GLBitmapFont.hpp> 20 #include <TextInput.hpp> 21 22 #include <Singleton.hpp> 23 24 const int VIDEO_DEFAULT_WIDTH=640; 25 const int VIDEO_DEFAULT_HEIGHT=480; 26 27 const int VIDEO_ORTHO_WIDTH=1000; 28 const int VIDEO_ORTHO_HEIGHT=750; 29 30 class Video 31 { 32 friend class Singleton<Video>; 33 public: 34 bool init( void); 35 bool update( void); 36 void updateLogic( void); 37 getWidth(void)38 int getWidth( void) { return _width;} getHeight(void)39 int getHeight( void) { return _height;} 40 toggleCritterBoard(void)41 void toggleCritterBoard( void) 42 { 43 _boardVisible = !_boardVisible; 44 } 45 46 void takeSnapshot( void); 47 48 private: 49 ~Video(); 50 Video( void); 51 Video( const Video&); 52 Video &operator=(const Video&); 53 54 void reload( void); 55 bool updateSettings( void); 56 bool setVideoMode( void); 57 58 bool _isFullscreen; 59 bool _showStarfield; 60 bool _showNebulas; 61 62 int _maxFPS; 63 float _fpsStepSize; 64 65 int _bpp; 66 int _width; 67 int _height; 68 69 GLBitmapFont *_smallFont; 70 GLBitmapFont *_scoreFont; 71 GLBitmapFont *_gameOFont; 72 73 GLBitmapCollection *_board; 74 int _boardIndex; 75 bool _boardVisible; 76 float _boardPosX; 77 78 std::string _statusMsg; 79 bool _statusMsgActive; 80 float _statusMsgWidth; 81 float _statusMsgPos; 82 83 GLTexture *_titleA; 84 GLTexture *_titleB; 85 86 float _angle; 87 float _prevAngle; 88 89 TextInput _textInput; 90 }; 91 92 typedef Singleton<Video> VideoS; 93