|
남병철.레조 님이 쓰신 글 :
:
: 안녕하세요? 레조입니다.
:
: 일단 컴파일은 무사히됩니다.
: 선언문법에러가 나지않고 잘되네요.
: extern으로 아래에 추가하고 클래스 중 DrawLine을
: 고쳐서 화면에 cout 찍는걸 살짝 해봤습니다. ^^
: 특별히 컴파일이 안될이유는 없는듯..(그냥 되어서.. ^^;)
: 제가 컴파일한 파일을 첨부합니다.
:
:
:
: 지니 님이 쓰신 글 :
: : 제가 클래스를 한개 만들었는데요
: : 자꾸 클래스에서 에러가 나네요
: : ㅠㅠ
: : Error VIDEOT~1.H 4: Declaration syntax error
: :
: : 이게 무슨 에러인가요??
: : 밑에 있는게 해더파일인데요.. 이게 어찌 된 일인지..ㅠㅠ
: : 제발 갈켜주세요..
: :
: : //videot~1.h
: : class VideoText {
: : private:
: : struct pageInfo {
: : unsigned int x, // cursor x coordinate
: : y, // cursor y coordinate
: : segment_addr, // video buf segment
: : base_offset; // offset w/in video buf
: : unsigned char previous_active_page, // prev active video page #
: : active_page, // current active video page #
: : previous_video_mode, // prev video mode
: : video_mode; // current video mode
: : unsigned int bytes_per_char, // video buf bytes per char
: : chars_per_row, // video buf chars per row
: : rows_per_screen; // video buf rows per screen
: : unsigned char attribute; // current active attribute
: : unsigned int *previous_buffer, // ptr to prev video buf
: : // before VideoText
: : *buffer; // ptr to current
: : // VideoText buffer
: : };
: :
: : struct pageInfo page;
: :
: : void Array2Page // load VideoText buffer
: : ( unsigned int *buffer ); // to video buf
: :
: : void Page2Array // load video buf to
: : ( unsigned int *buffer ); // VideoText buffer
: :
: : unsigned int GetOffset // Calculate video buf offset
: : ( unsigned int x, unsigned int y ); // for (x,y) pair
: :
: : void PopPage( void ); // restore prev video state
: :
: : void PushPage( void ); // store prev video state
: :
: : int peek(unsigned segment, unsigned offset);
: :
: : void poke(unsigned segment, unsigned offset, int value);
: :
: : public:
: : VideoText( int page_num = 0 ); // constructor
: :
: : ~VideoText( ); // destructor
: :
: : unsigned char GetAttribute( void ); // Retrieve current attributes
: :
: : void SetAttribute // Set current attributes
: : ( unsigned char attribute );
: :
: : void GoToXY( int x, int y ); // move current video buf
: : // cursor location to (x,y)
: :
: : void WriteChar( unsigned char ch ); // Write one char at video
: : // buf cursor location (x,y)
: : // using current attributes
: :
: : void WriteString // Write str at video
: : ( unsigned char * str ); // buf cursor location (x,y)
: : // using current attributes
: :
: : void ClearScreen( void ); // clear entire video buf
: :
: : void DrawLine( int x1, int y1, // Draw line to video buf
: : int x2, int y2 ); // from (x1,y1) to (x2,y2)
: :
: : void DrawBox( int x1, int y1, // Draw box to video buf
: : int x2, int y2 ); // (x1,y1) top left corner
: : // (x2,y2) bottom right corner
: :
: : void ShowPage( void ); // Writes current VideoText
: : // buffer contents to video
: : // buf
: :
: : void HidePage( void ); // Writes video buf
: : // contents to current
: : // VideoText buffer and then
: : // clears entire video buf
: :
: : // Here are the text character attributes
: : enum attributes {
: : fgBlack = 0x00, // Foreground attributes
: : fgBlue = 0x01,
: : fgGreen = 0x02,
: : fgRed = 0x04,
: : fgWhite = 0x07,
: : fgIntense = 0x08,
: : bgBlack = 0x00, // Background attributes
: : bgBlue = 0x10,
: : bgGreen = 0x20,
: : bgRed = 0x40,
: : bgWhite = 0x70,
: : Blinking = 0x80};
: : };
|