r4493@vps: verhaegs | 2007-04-19 14:44:00 -0400
[AROS.git] / rom / graphics / finddisplayinfo.c
blob231293854d33d29b2f25a57176889e483b56f614
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function FindDisplayInfo()
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include <proto/graphics.h>
10 #include <graphics/displayinfo.h>
11 #include <hidd/graphics.h>
12 #include "dispinfo.h"
13 #include "graphics_intern.h"
15 /*****************************************************************************
17 NAME */
18 #include <proto/graphics.h>
20 AROS_LH1(DisplayInfoHandle, FindDisplayInfo,
22 /* SYNOPSIS */
23 AROS_LHA(ULONG, ID, D0),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 121, Graphics)
28 /* FUNCTION
29 Search for a DisplayInfo which matches the ID key.
31 INPUTS
32 ID - identifier
34 RESULT
35 handle - handle to a displayinfo record with that key
36 or NULL if no match
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 graphics/displayinfo.h
47 INTERNALS
49 HISTORY
52 ******************************************************************************/
54 AROS_LIBFUNC_INIT
55 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
57 DisplayInfoHandle ret = NULL;
58 HIDDT_ModeID hiddmode;
59 OOP_Object *sync, *pixfmt;
61 D(bug("FindDisplayInfo(id=%x)\n", ID));
63 /* Check for the NOTNULLMASK */
64 if ((ID & NOTNULLMASK) != NOTNULLMASK) {
65 D(bug("!!! NO AROS MODEID IN FindDisplayInfo() !!!\n"));
66 return NULL;
69 hiddmode = AMIGA_TO_HIDD_MODEID(ID);
71 /* Try to get mode info for the mode */
72 if (!HIDD_Gfx_GetMode(SDD(GfxBase)->gfxhidd, hiddmode, &sync, &pixfmt)) {
73 D(bug("!!! NO AROS MODEID IN FindDisplayInfo() !!!\n"));
74 return NULL;
77 ret = (DisplayInfoHandle)ID;
79 return ret;
81 AROS_LIBFUNC_EXIT
82 } /* FindDisplayInfo */