Linux drawing in text mode(no gui, desktop)

大兔子大兔子 提交于 2019-12-11 06:56:33

问题


I'm kind of new to linux without a gui and i run into a problem. When using a linux distro with gui, it looks easy to draw on a window using a library(opengl, sdl). I wanted to create a chip8 emulator in c++, but how can i handle drawing on screen? Or any library that can draw in text based linux, or just usage of opengl in text based linux. Thanks! Btw! I'm using bash in windows and a vagrant machine running precise64.


回答1:


For text mode drawing you might want to investigate NCURSES:

http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/

With this you can print in colour to character cells on a console screen, so that might be just what you need for emulating a machine with a character-mapped display.

There is also a version of the old Windows "conio.h" library if you want to start with something very simple:

https://ubuntuforums.org/showthread.php?t=1353043&p=8485667#post8485667

There is an excellent simple tutorial for SDL graphics at:

http://lodev.org/cgtutor/quickcg.html



来源:https://stackoverflow.com/questions/43723558/linux-drawing-in-text-modeno-gui-desktop

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!