View Single Post
Old 26 August 2009, 04:02   #1
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,133
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();
 }

Last edited by NovaCoder; 28 August 2009 at 01:03.
NovaCoder is offline  
 
Page generated in 0.05303 seconds with 11 queries