The code now properly updates and writes to the console.

This commit is contained in:
felicianoa237
2025-03-24 19:11:24 -05:00
parent 806041eaaa
commit 30dc582241
16 changed files with 220 additions and 1346 deletions

View File

@@ -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;
}