English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. General (http://eab.abime.net/forumdisplay.php?f=37)
-   -   A progressive 320x200 VGA screen on AGA (http://eab.abime.net/showthread.php?t=47023)

NovaCoder 26 August 2009 04:02

A progressive 320x200 VGA screen on AGA
 
Ok, this seems to do what I want. It tries to open a VGA 320x200 screen (using a 320x240 mode...natch), if the user hasn't got the approprite monitor driver it will then find the best matching 320x200 mode.

Code:

ULONG mode = BestModeID(BIDTAG_NominalWidth, 320,
                BIDTAG_NominalHeight, 200,
                BIDTAG_DesiredWidth, 320,
                BIDTAG_DesiredHeight, 200,
                BIDTAG_Depth, TBITPLANES,
                BIDTAG_MonitorID, VGA_MONITOR_ID,
                TAG_END);

  if(mode == INVALID_ID) {
    mode = BestModeID(BIDTAG_NominalWidth, 320,
                BIDTAG_NominalHeight, 200,
                BIDTAG_DesiredWidth, 320,
                BIDTAG_DesiredHeight, 200,
                BIDTAG_Depth, TBITPLANES,
                TAG_END);
 }

 if(mode == INVALID_ID) {
  CloseScreen(screen);
  errorexit();
 }

screen = OpenScreenTags(NULL,
  SA_DisplayID, mode,
  SA_Width,  320,
  SA_Height,  200,
  SA_Depth,  TBITPLANES,
  SA_Type,  CUSTOMSCREEN,
  SA_Overscan, OSCAN_STANDARD,
  SA_ShowTitle, FALSE,
  SA_Exclusive, TRUE,
  TAG_END);

 if(screen == NULL)
  errorexit();

 window = OpenWindowTags(NULL,
  WA_Left, 0,
  WA_Top, 0,
  WA_Width, screen->Width,
  WA_Height, screen->Height,
  WA_Title, NULL,
  WA_CustomScreen, screen,
  WA_Borderless, TRUE,
  WA_DragBar, FALSE,
  WA_Activate, TRUE,
  WA_SmartRefresh, TRUE,
  WA_Backdrop, TRUE,
  WA_NoCareRefresh, TRUE,
  WA_IDCMP, IDCMP_RAWKEY,
  TAG_END);

 if(window==NULL)
 {
  CloseScreen(screen);
  errorexit();
 }



All times are GMT +2. The time now is 20:33.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.

Page generated in 0.05440 seconds with 11 queries