Permalink
Browse files

Added Draw and Write methods

  • Loading branch information...
Jalae committed Feb 27, 2012
1 parent ea60a70 commit 0b71aa10cb00a57debdaaf2e5aed7c2c5fb3add0
Showing with 28 additions and 0 deletions.
  1. +28 −0 Console.h
View
@@ -203,7 +203,35 @@ class console
}
//Output Functions
+ void Draw()
+ {
+ SwapDisplayBuffers();
+ }
+ void Write(charT* str)
+ {
+ CHAR_INFO temp;
+ WORD attrib=8;
+ while(*str)
+ {
+ //figureout if str* is an escape sequence-|
+ //if it is change attrib to match---------|-1 function
+ ParseEscape(str, attrib);
+ //build temp
+ temp = BuildCharInfo(*str, attrib);
+ SMALL_RECT rec = {vCursorPos.X,vCursorPos.Y,vCursorPos.X,vCursorPos.Y};
+ WriteConsoleOutput(
+ ConsoleState->out_buffer,
+ &temp,
+ ONE_COORD,
+ ORIGIN,
+ &rec
+ );
+ vCursorPos.X++;
+ str++;
+ }
+
+ }
//Input Functions

0 comments on commit 0b71aa1

Please sign in to comment.