Im trying to write an ascii game for an assignment. The program must be written entirely in c, no c++. How can i get the program to open a window capable of ren开发者_运维技巧dering ascii art? I want to create a window of a certain size, that is capable of printing in multiple colors. A simple console window is insufficient.
Also, on a related note, can anyone show me a function that will write directly to the buffer? printf is too slow, and doesnt seem to be versatile enough for the graphics i want to produce.
Any help will be greatly appreciated. Thanks in advance.
A simple console window is insufficient.
I disagree. A console window is perfectly fine for anything you seem to want to do. Colours, full ascii range, highlighting...
Also, on a related note, can anyone show me a function that will write directly to the buffer? printf is too slow,
How fast do you need to write? If you're forming the strings yourself and calling printf, it essentially just copies it into the buffer for you.
try ncurses
altho i dont think it works for windows at this time (v5.7)
or even AAlib
You want the Windows Console API there are functions in there to do exactly what you are asking. For example use SetConsoleDisplayMode to change the console size.
精彩评论