Pages vues depuis 06/01/2019 : 13 130 407
Index du forum »» Développement »» [Résolu] - Compilation de ScreenModeReq.c
/****************************************************************/
static BOOL scrModeFilter( struct Hook *hook, struct ScreenModeRequester *smr, ULONG modeID )
{
ASSERT( hook );
ASSERT( smr );
struct DimensionInfo di;
if( GetDisplayInfoData( NULL, (UBYTE*)&di, sizeof(struct DimensionInfo), DTAG_DIMS, modeID ) >= (BYTE*)&di.Nominal.MaxY + 2 - (BYTE*)&di )
{
if( di.Nominal.MaxX+1 < ECR_W || di.Nominal.MaxX-1 > ECR_W || di.Nominal.MaxY+1 < ECR_H || di.Nominal.MaxY-1 > ECR_H || di.MaxDepth < DEPTH )
return FALSE;
}
return TRUE;
}
/****************************************************************/
void demande_ecran(void)
{
//**** declaration des variables
struct ScreenModeRequester *req;
struct Hook hook = { {NULL, NULL}, (HOOKFUNC)HookEntry, (HOOKFUNC)scrModeFilter, 0 };
struct DisplayInfo di;
//**** ouverture ecran
req = (struct ScreenModeRequester *) AllocAslRequestTags( ASL_ScreenModeRequest,
ASLSM_FilterFunc, (ULONG)&hook,
ASLSM_TitleText, (ULONG)"Choix écran",
TAG_END );
if( AslRequest( req, NULL ) )
{
modeID = req->sm_DisplayID;
}
FreeAslRequest( req );
if( GetDisplayInfoData( NULL, (UBYTE*)&di, sizeof(struct DisplayInfo), DTAG_DISP, modeID ) >= (BYTE*)&di.PropertyFlags + 4 - (BYTE*)&di )
{
if( di.PropertyFlags & DIPF_IS_FOREIGN ) depth = 8;
}
if(modeID==INVALID_ID) quitp("Pas d'écran\n");
}
/****************************************************************/
Message édité par : Papiosaur / 17-02-2009 09:53