home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************/
- /* */
- /* Amiga C Encyclopedia (ACE) V3.0 Amiga C Club (ACC) */
- /* ------------------------------- ------------------ */
- /* */
- /* Book: ACM Amiga Amiga C Club */
- /* Chapter: Hints And Tips Tulevagen 22 */
- /* File: Example1.c 181 41 LIDINGO */
- /* Author: Anders Bjerin SWEDEN */
- /* Date: 92-05-07 */
- /* Version: 1.10 */
- /* */
- /* Copyright 1992, Anders Bjerin - Amiga C Club (ACC) */
- /* */
- /* Registered members may use this program freely in their */
- /* own commercial/noncommercial programs/articles. */
- /* */
- /***********************************************************/
-
- /* This example tell you if you have an American (NTSC) or */
- /* European (PAL) system. */
-
-
- /* Declares commonly used data types, such as UWORD etc: */
- #include <exec/types.h>
-
- /* This header file declares the GfxBase structure: */
- #include <graphics/gfxbase.h>
-
-
- /* Pointer to the GfxBase structure. NOTE! This pointer must */
- /* allways be called "GfxBase"! */
- struct GfxBase *GfxBase;
-
-
- main()
- {
- /* Open the Graphics Library: (any version) */
- GfxBase = (struct GfxBase *)
- OpenLibrary( "graphics.library", 0 );
-
- if( !GfxBase )
- exit(); /* ERROR! Could not open the Graphics Library! */
-
-
- if( GfxBase->DisplayFlags & NTSC )
- printf( "You have an American (NTSC) Amiga.\n" );
-
- if( GfxBase->DisplayFlags & PAL )
- printf( "You have an European (PAL) Amiga.\n" );
-
-
- /* Close the Graphics Library: */
- CloseLibrary( GfxBase );
-
-
- /* Wait for a while: */
- Delay( 5 * 50 );
- }
-