diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-09-17 08:43:11 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-09-17 08:45:40 +1000 |
commit | 036ad5d3dd368d2836ed0148143da786f48f15e0 (patch) | |
tree | 023d91849252f15be2fd5bae4725441509e60010 /demos/modules/gdisp | |
parent | 7f8e1a7dead66b8966fd6a4dcebcd559a0754c8a (diff) | |
download | uGFX-036ad5d3dd368d2836ed0148143da786f48f15e0.tar.gz uGFX-036ad5d3dd368d2836ed0148143da786f48f15e0.tar.bz2 uGFX-036ad5d3dd368d2836ed0148143da786f48f15e0.zip |
SImplify the options for multiple displays.
This will also be more compatible with newmouse infrastructure
Diffstat (limited to 'demos/modules/gdisp')
-rw-r--r-- | demos/modules/gdisp/multiple_displays/gfxconf.h | 28 | ||||
-rw-r--r-- | demos/modules/gdisp/multiple_displays/main.c | 10 |
2 files changed, 22 insertions, 16 deletions
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)); |