home *** CD-ROM | disk | FTP | other *** search
- #include "visual.h"
- #include "screen.h"
-
- #include<utility/tagitem.h>
-
- #include<stdio.h>
-
- #include<clib/gadtools_protos.h>
-
- /* Global record of the screen's visual information */
- static APTR vinfo = NULL;
-
- int createVisual()
- {
- /* Get the visual info so GadTools can render the gadgets nicely */
- if(vinfo = GetVisualInfo(getScreen(), TAG_DONE))
- /* Succeeded */
- return TRUE;
- else
- printf("Error: could not get visual info\n");
- return FALSE;
- }
-
- void freeVisual()
- {
- if(vinfo)
- {
- FreeVisualInfo(vinfo);
- vinfo = NULL;
- }
- }
-
- APTR getVisual()
- {
- return vinfo;
- }
-