aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gdisp/multiple_displays
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-09-17 08:43:11 +1000
committerinmarket <andrewh@inmarket.com.au>2014-09-17 08:43:11 +1000
commitffa03cb57042e9460f6193e5a284a3760b1b348f (patch)
treeb40f4eb9b87d8285d15d27820359f58051351d77 /demos/modules/gdisp/multiple_displays
parente586459a24c3c5bd383ef0045911dd155c47ef7f (diff)
downloaduGFX-ffa03cb57042e9460f6193e5a284a3760b1b348f.tar.gz
uGFX-ffa03cb57042e9460f6193e5a284a3760b1b348f.tar.bz2
uGFX-ffa03cb57042e9460f6193e5a284a3760b1b348f.zip
SImplify the options for multiple displays.
This will also be more compatible with newmouse infrastructure
Diffstat (limited to 'demos/modules/gdisp/multiple_displays')
-rw-r--r--demos/modules/gdisp/multiple_displays/gfxconf.h28
-rw-r--r--demos/modules/gdisp/multiple_displays/main.c10
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));