Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
console.h
Package: celestia-1.6.0.tar.gz [view]
Upload User: center1979
Upload Date: 2022-07-26
Package Size: 50633k
Code Size: 2k
Category:
OpenGL program
Development Platform:
Visual C++
- // console.h
- //
- // Copyright (C) 2003, Chris Laurel <claurel@shatters.net>
- //
- // This program is free software; you can redistribute it and/or
- // modify it under the terms of the GNU General Public License
- // as published by the Free Software Foundation; either version 2
- // of the License, or (at your option) any later version.
- #ifndef _CELENGINE_CONSOLE_H_
- #define _CELENGINE_CONSOLE_H_
- #include <string>
- #include <iostream>
- #include <celtxf/texturefont.h>
- class Console;
- // Custom streambuf class to support C++ operator style output. The
- // output is completely unbuffered.
- class ConsoleStreamBuf : public std::streambuf
- {
- public:
- ConsoleStreamBuf() : console(NULL) { setbuf(0, 0); };
- void setConsole(Console*);
- int overflow(int c = EOF);
- enum UTF8DecodeState
- {
- UTF8DecodeStart = 0,
- UTF8DecodeMultibyte = 1,
- };
- private:
- Console* console;
- UTF8DecodeState decodeState;
- wchar_t decodedChar;
- unsigned int decodeShift;
- };
- class Console : public std::ostream
- {
- public:
- Console(int _nRows, int _nColumns);
- ~Console();
- bool setRowCount(int _nRows);
- void begin();
- void end();
- void render(int rowHeight);
- void setScale(int, int);
- void setFont(TextureFont*);
- void print(wchar_t);
- void print(char*);
- void newline();
- #if 0
- void printf(const char*, ...);
- #endif
- int getRow() const;
- int getColumn() const;
- int getWindowRow() const;
- void setWindowRow(int);
- void setWindowHeight(int);
- int getHeight() const;
- int getWidth() const;
- private:
- wchar_t* text;
- int nRows;
- int nColumns;
- int row;
- int column;
- int windowRow;
- int windowHeight;
- int xscale;
- int yscale;
- TextureFont* font;
- ConsoleStreamBuf sbuf;
- bool autoScroll;
- };
- #endif // _CELENGINE_CONSOLE_H_