www.pudn.com > Gimcrack-v0.0051-Source.zip > console.h


#ifndef _CONSOLE_H_ 
#define _CONSOLE_H_ 
 
#include  
#include  
#include "../texture.h" 
#include "../global.h" 
#include "font.h" 
 
enum	ConsoleState { Raised, Lowered }; 
#define CONSOLEBUFFER 50 
#define CMDLINE 80 
 
class GcConsole 
{ 
	public: 
		GcConsole(); 
		void Load(); 
		void SetSize( int width, int height ); 
		void Draw(); 
		void TurnOn(); 
		void TurnOff(); 
		void Toggle(); 
		bool Active() { return ( (m_state == Lowered) ? (true) : (false) ); } 
		void SendKey( uint key ); 
		void AddBuffer( char * text ); 
 
	private: 
		void RenderBackground(); 
		void RenderBuffers(); 
		void RenderCmdLine(); 
		void Slide(); 
	 
		bool m_active; 
		ConsoleState m_state; 
 
		float m_x, m_y; 
		float m_width; 
		float m_height; 
 
		bool m_sliding; 
		int m_slide_speed; 
 
		GcTexture bg_tex; 
		GcFont font; 
		float tile_repeat; 
 
		char CmdLine[CMDLINE]; 
		int  CurrentPos; 
		char Buffer[CONSOLEBUFFER][CMDLINE]; 
 
}; 
 
#endif // _CONSOLE_H_