开发者

generate a window for ascii game

开发者 https://www.devze.com 2022-12-17 08:01 出处:网络
Im trying to write an ascii game for an assignment. The program must be written entirely in c, no c++.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号