2 Copyright © 2010-2018, The AROS Development Team. All rights reserved.
6 #include <aros/symbolsets.h>
7 #include <proto/exec.h>
12 #include LC_LIBDEFS_FILE
14 CONST_STRPTR softpipe_str
= "softpipe";
16 static int Init(LIBBASETYPEPTR LIBBASE
)
18 InitSemaphore(&LIBBASE
->driversemaphore
);
20 LIBBASE
->basegallium
= OOP_FindClass(CLID_Hidd_Gallium
);
21 if (!LIBBASE
->basegallium
)
24 LIBBASE
->gfxAttrBase
= OOP_ObtainAttrBase((STRPTR
)IID_Hidd_Gfx
);
25 if (!LIBBASE
->gfxAttrBase
)
28 LIBBASE
->bmAttrBase
= OOP_ObtainAttrBase((STRPTR
)IID_Hidd_BitMap
);
29 if (!LIBBASE
->bmAttrBase
)
32 LIBBASE
->galliumAttrBase
= OOP_ObtainAttrBase((STRPTR
)IID_Hidd_Gallium
);
33 if (!LIBBASE
->galliumAttrBase
)
36 LIBBASE
->fallback
= (char *)softpipe_str
;
37 LIBBASE
->fallbackmodule
= NULL
;
39 /* Cache method IDs that we use */
40 LIBBASE
->galliumMId_UpdateRect
=
41 OOP_GetMethodID(IID_Hidd_BitMap
, moHidd_BitMap_UpdateRect
);
42 LIBBASE
->galliumMId_DisplayResource
=
43 OOP_GetMethodID(IID_Hidd_Gallium
, moHidd_Gallium_DisplayResource
);
48 static int Expunge(LIBBASETYPEPTR LIBBASE
)
51 OOP_DisposeObject(LIBBASE
->driver
);
53 if (LIBBASE
->galliumAttrBase
)
54 OOP_ReleaseAttrBase((STRPTR
)IID_Hidd_Gallium
);
56 if (LIBBASE
->bmAttrBase
)
57 OOP_ReleaseAttrBase((STRPTR
)IID_Hidd_BitMap
);
59 if (LIBBASE
->gfxAttrBase
)
60 OOP_ReleaseAttrBase((STRPTR
)IID_Hidd_Gfx
);
62 if (LIBBASE
->drivermodule
)
63 CloseLibrary(LIBBASE
->drivermodule
);
69 ADD2EXPUNGELIB(Expunge
, 0);
71 ADD2LIBS((STRPTR
)"gallium.hidd", 0, static struct Library
*, GalliumHiddBase
);