From ffa03cb57042e9460f6193e5a284a3760b1b348f Mon Sep 17 00:00:00 2001 From: inmarket Date: Wed, 17 Sep 2014 08:43:11 +1000 Subject: SImplify the options for multiple displays. This will also be more compatible with newmouse infrastructure --- demos/modules/gdisp/multiple_displays/gfxconf.h | 28 ++++++++++++++----------- demos/modules/gdisp/multiple_displays/main.c | 10 +++++---- 2 files changed, 22 insertions(+), 16 deletions(-) (limited to 'demos') diff --git a/demos/modules/gdisp/multiple_displays/gfxconf.h b/demos/modules/gdisp/multiple_displays/gfxconf.h index 60467f93..959f1d0b 100644 --- a/demos/modules/gdisp/multiple_displays/gfxconf.h +++ b/demos/modules/gdisp/multiple_displays/gfxconf.h @@ -46,16 +46,20 @@ #define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_TOTAL_DISPLAYS 2 - -/* Uncomment the following lines if you want to use multiple displays on - * different controllers. +/* You must either define GDISP_TOTAL_DISPLAYS or GDISP_DRIVER_LIST for multiple displays. + * You cannot define both! + * + * Defining GDISP_TOTAL_DISPLAYS will create multiple instances of the one default driver. + * Defining GDISP_DRIVER_LIST allows you to specify multiple different drivers. * - * Change the definitions to suit your hardware. - * Currently all controllers must use the same pixel format. + * Extra Notes for GDISP_DRIVER_LIST: + *----------------------------------- * - * Remember that GDISP_TOTAL_DISPLAYS above must match the **Total** - * number of displays in your system across all controllers. + * The same controller can appear more than once in the list. + * + * You must specify a GDISP_PIXELFORMAT that the application will work in. This + * is translated into each drivers internal pixel format by the driver. You the + * pixel format that is most common accross your drivers (for efficiency). * * Optionally, you can also specify hardware characteristics that are common to * all your controllers. This significantly improves code and speed efficiency @@ -72,9 +76,9 @@ * #define GDISP_HARDWARE_DRAWPIXEL TRUE * #define GDISP_HARDWARE_FILLS TRUE */ -//#define GDISP_TOTAL_CONTROLLERS 2 -//#define GDISP_CONTROLLER_LIST GDISPVMT_Win32, GDISPVMT_Win32 -//#define GDISP_CONTROLLER_DISPLAYS 1, 1 -//#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 +#define GDISP_TOTAL_DISPLAYS 2 + +//#define GDISP_DRIVER_LIST GDISPVMT_Win32, GDISPVMT_Win32 +//#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 #endif /* _GFXCONF_H */ diff --git a/demos/modules/gdisp/multiple_displays/main.c b/demos/modules/gdisp/multiple_displays/main.c index 4e8a5a08..c4c37bed 100644 --- a/demos/modules/gdisp/multiple_displays/main.c +++ b/demos/modules/gdisp/multiple_displays/main.c @@ -46,7 +46,7 @@ #if USE_METHOD_1 int main(void) { coord_t width, height; - coord_t display, i, j; + coord_t display, i, j, cnt; font_t f; GDisplay *g; char buf[16]; @@ -58,7 +58,8 @@ f = gdispOpenFont("*"); /* Cycle through each display */ - for(display = 0; display < GDISP_TOTAL_DISPLAYS; display++) { + cnt = gdispGetDisplayCount(); + for(display = 0; display < cnt; display++) { // Get the specified display g = gdispGetDisplay(display); @@ -84,7 +85,7 @@ #else int main(void) { coord_t width, height; - coord_t display, i, j; + coord_t display, i, j, cnt; font_t f; char buf[16]; @@ -95,7 +96,8 @@ f = gdispOpenFont("*"); /* Cycle through each display */ - for(display = 0; display < GDISP_TOTAL_DISPLAYS; display++) { + cnt = gdispGetDisplayCount(); + for(display = 0; display < cnt; display++) { // Set the default display to the specified display gdispSetDisplay(gdispGetDisplay(display)); -- cgit v1.2.3