![]() For example, to set the colors to yellow text on a red background, you would use this pair of functions: _settextcolor(14) Use the _settextcolor function to set the text "foreground" color and _setbkcolor to set the text "background" color. You can set both the text color and the color behind it. ![]() Background colors are addressed with color indices 0 through 7, and text colors can be any value from 0 to 15: _setvideomode(_DEFAULTMODE) Įvery PC built after 1981's Color/Graphics Adapter supports 16 text colors and 8 background colors. ![]() For that, you can use _DEFAULTMODE as the mode. When you're done with your program and ready to exit back to DOS, you should reset the video mode back to whatever values it had before. ![]() This function takes one of several possible values, but for most programs that run in color mode in a standard 80x25 screen, use _TEXTC80 as the mode. On OpenWatcom, you do this with the _setvideomode function. To start, you need to set the video mode. And that means DOS conio programs can easily access video modes and leverage screen regions in ways that are difficult using Linux ncurses. On DOS, everything is running on hardware. This is different from the ncurses library on Linux, where everything is displayed through terminal emulation. Setting the video modeĮverything you do is immediately displayed on-screen via hardware. Let's get started with the OpenWatcom conio functions. Because the OpenWatcom C Compiler has been used for a long time by many developers, this conio implementation is also quite popular. ![]() eBook: An introduction to programming with Bashįor years, FreeDOS included the OpenWatcom C Compiler in the standard distributions. OpenWatcom supports its own version of conio, implemented in conio.h for particular console input and output functions, and in graph.h to set colors and perform other manipulation.Try for free: Red Hat Learning Subscription. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |