The code now properly updates and writes to the console.
This commit is contained in:
@@ -73,21 +73,29 @@ void getBufferInfo(HANDLE *hHandle, CONSOLE_SCREEN_BUFFER_INFO *pCSBI)
|
||||
}
|
||||
|
||||
void printList(HANDLE *pHConsole, DWORD *pCharsWritten, Entity *pE)
|
||||
{
|
||||
HANDLE *bhConsole;
|
||||
bhConsole = &pHConsole;
|
||||
DWORD *bCharsWritten;
|
||||
bCharsWritten = &pCharsWritten;
|
||||
for (int counter = 0; counter < 10 ;counter++)
|
||||
{
|
||||
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
//COORD coordScreen = {0, 0};
|
||||
DWORD cCharsWritten;
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
GetConsoleScreenBufferInfo(hConsole, &csbi);
|
||||
HANDLE *bhConsole;
|
||||
DWORD *bCharsWritten;
|
||||
for (int counter = 0; counter < 5 ;counter++)
|
||||
{
|
||||
Entity bE = pE[counter];
|
||||
if (!WriteConsoleOutputCharacter(bhConsole,
|
||||
WriteConsoleOutputCharacter(pHConsole,
|
||||
(LPCSTR) pE[counter].avatar,
|
||||
1,
|
||||
pE[counter].position,
|
||||
pCharsWritten);
|
||||
/*if (!WriteConsoleOutputCharacter(pHConsole,
|
||||
&bE.avatar,
|
||||
1,
|
||||
bE.position,
|
||||
pCharsWritten)) {
|
||||
// printf("Error: Unable to write to console. Error code: %ld\n", GetLastError());
|
||||
}
|
||||
// // printf("Error: Unable to write to console. Error code: %ld\n", GetLastError());
|
||||
}*/
|
||||
// printf("Avatar :%s",&e->avatar);
|
||||
//e = (Entity *) e->next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user