Turbo C 2.0 is a 16-bit DOS C compiler developed by Borland. Now Turbo C is already old antiques, and it is very few people. However, it is still necessary to study DOS and Turbo C. The 256-color programming of VGA / VESA has always been focus on the focus of DOS and TC programming. The TC256 graphics library told in this article is a graphics library that Wu Jinweked a support SVGA256 color video mode. Many beginners don't understand their usage, this article is simply speaking here. After watching the command line program that I hate TC, it is more uncomfortable, so I am eager to do a little TC's graphic programming. TC's own Graphics library is a good choice, but it also has a shortcoming that can only support VGAHI graphic mode, that is, 640 * 480 * 16 colors, and the performance of the image is really too bad.
Fortunately, I found a full-time TC256 graphic function library, which supports SVGA's 640 * 480 * 256 colors of video mode, supports the output of Chinese characters, mouse features, 256 color bitmap output, EMS memory management, basics Drawing functions, image specific effects (animation, alpha mix), etc. comprehensive and powerful features. This article does not intend to explore the use of each function of the library, but only specifically, the use of the library, compile methods, and programming and compiling problems.
Instructions. Installation is very simple, all functions are placed in the Include directory in the source code. Oh files can be copied to your TC's include directory. Generally, this step is no problem.
When programming, #include
Usually use this function library using the following frame: #include
We can insert all graphical operations and your program code into init256 (); and close256 (); between two sentences, this is also a specification of a pair of encoding (for pairing coding, please refer to this site " Specification "one article).
About compiling problems. Since the TC256 library uses EMS memory, and requires compilation using memory mode over Compact, it is necessary to change memory mode in TC's options-> compile-> model, generally changed to huge. Don't forget to save (options-> Save Options) after you finish. After saving, you can compile, it can be run after the compilation is passed. However, in the Windows operating system, there may be problems that do not have EMS memory drivers (after dual-click, the general symptom is the program running). The solution under WinXP is to right-click the program that you build, select the "Properties" item, select the "Memory" tab in the pop-up dialog, set the EMS memory to the largest (default is not, select the bottom of the drop-down list One can be), click OK after setting, now generate a MS-DOS shortcut to the program in the same directory, don't think it is not pleasing to the eye, you can delete it, your program is running normally Rely on it. At this moment, double-click your program, you can run it normally. It doesn't seem to be in Windows 2000, although it can be set as above, but the program will not be able to run, I heard that I can install one of the software, but now I still don't get Win2000 problem, then study. Under Win95 / 98, the program should be able to run normally.
Write errors that are often criminalized when writing programs. People who have used TC256 libraries should know the PUTS256 () function, it is output a Chinese string on the screen, look at the code: #include
In addition, the possible mistake is that the output of Chinese characters should be used to use two point branches, respectively, HZK16 and HZK24, if your program can't find these two files, the output of Chinese characters will fail, usually released your When procedures, just put your programs and two HZK files in the same directory. (Note: Two HZK files can be found in the compression package of TC256, respectively).
(Endlessly)
Author: Chen Kai 2004.7.10 All Rights Reserved