![]() To clear the entire screen, give the value _GCLEARSCREEN to the function. The _clearscreen function does double duty to clear either the full screen or just the window that's currently defined. You can also clear the window with a background color. Placing text at 1,1 will actually position that text at row 5 and column 10, where the window starts on the screen. Now that you've defined the window, any text you draw in it uses 1,1 as the upper-left corner of the text window. ![]() To define a text window starting at row 5 and column 10, and extending to row 15 and column 70, you use the _settextwindow function like this: _settextwindow(5, 10, 15, 70) These regions can take up the whole screen or be as small as a single line. Once you define a window, you can clear it with a background color and position text in it. These are called text windows and are a really cool feature of conio.Ī text window is just an area of the screen, defined as a rectangle starting at a particular row, col and ending at a different row, col. The trick to unleashing the power of conio is to leverage a feature of the PC video display where a program can control the video hardware by region. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |