在文本模式下的Linux绘图(无gui,桌面) [英] Linux drawing in text mode(no gui, desktop)

查看:260
本文介绍了在文本模式下的Linux绘图(无gui,桌面)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有gui,对于linux来说很新,而且我遇到了一个问题。当使用带gui的linux发行版时,使用库(opengl,sdl)在窗口上绘图很容易。我想在c ++中创建一个chip8仿真器,但是我如何处理屏幕上的绘图?或者任何可以在基于文本的linux中绘制的库,或者仅在基于文本的linux中使用opengl。谢谢!
Btw!我在Windows和bash中使用bash,并运行precise64。



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



使用此功能,您可以在控制台屏幕上以字符单元的颜色进行打印,以便可能正是你用模拟字符映射显示来模拟机器所需要的。



如果你想要的话,还有一个老版本的Windowsconio.h库从一些非常简单的事情开始:

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



简单的SDL图形教程:

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


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.

解决方案

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

这篇关于在文本模式下的Linux绘图(无gui,桌面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆