IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

HOWTOs

Search Howtos :Match :

13. Screen Manipulation

In this section, we will look into some functions, which allow us to manage the screen efficiently and to write some fancy programs. This is especially important in writing games.

13.1. getyx() functions

The function getyx() can be used to find out the present cursor co-ordinates. It will fill the values of x and y co-ordinates in the arguments given to it. Since getyx() is a macro you don't have to pass the address of the variables. It can be called as

    getyx(win, y, x);
    /* win: window pointer
     *   y, x: y, x co-ordinates will be put into this variables 
     */

The function getparyx() gets the beginning co-ordinates of the sub window relative to the main window. This is some times useful to update a sub window. When designing fancy stuff like writing multiple menus, it becomes difficult to store the menu positions, their first option co-ordinates etc. A simple solution to this problem, is to create menus in sub windows and later find the starting co-ordinates of the menus by using getparyx().

The functions getbegyx() and getmaxyx() store current window's beginning and maximum co-ordinates. These functions are useful in the same way as above in managing the windows and sub windows effectively.

13.2. Screen Dumping

While writing games, some times it becomes necessary to store the state of the screen and restore it back to the same state. The function scr_dump() can be used to dump the screen contents to a file given as an argument. Later it can be restored by scr_restore function. These two simple functions can be used effectively to maintain a fast moving game with changing scenarios.

13.3. Window Dumping

To store and restore windows, the functions putwin() and getwin() can be used. putwin() puts the present window state into a file, which can be later restored by getwin().

The function copywin() can be used to copy a window completely onto another window. It takes the source and destination windows as parameters and according to the rectangle specified, it copies the rectangular region from source to destination window. It's last parameter specifies whether to overwrite or just overlay the contents on to the destination window. If this argument is true, then the copying is non-destructive.

Search Howtos :Match :
Thunderbird 2.0.0.18
An email and newsgroup client with powerful, new junk mail controls
JEdit 4.3pre16
Programmers text editor
Gdm 2.24.1
Reimplementation of the well known xdm program.
Damn Small Linux 4.4.10
Damn Small Linux, 50MB bootable Linux desktop LiveCD
PhpMyAdmin 3.1.0 rc1
Php front-end to MySQL administration
ImageMagick 6.4.5.8
ImageMagick image processing studio
SystemRescueCd 1.1.2
Bootable CDRom with Linux and all the important system utilities
Linux Kernel 2.6 2.6.28-rc5
Linux Kernel
LimeWire 4.18.8
Gnutella Client
Trac 0.11.2.1
Integrates SCM, Wiki and Issue Tracker
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

eWeek

The essential technology information source for builders of e-business.

BusinessWeek (Digital Edition)

Provides readers a deeper understanding of the trends that drive growth, and what best practices keep them ahead of the competition.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info