Index: examples/ex_window_constraints.c
===================================================================
--- examples/ex_window_constraints.c	(revision 15112)
+++ examples/ex_window_constraints.c	(working copy)
@@ -32,13 +32,29 @@
    al_init_font_addon();
 
    al_set_new_display_flags(ALLEGRO_RESIZABLE |
-      ALLEGRO_GENERATE_EXPOSE_EVENTS);
+      ALLEGRO_GENERATE_EXPOSE_EVENTS | ALLEGRO_OPENGL);
    display = al_create_display(640, 480);
    if (!display) {
       abort_example("Unable to set any graphic mode\n");
       return 1;
    }
 
+   min_w = 640;
+   min_h = 480;
+   max_w = 800;
+   max_h = 600;
+   constr_min_w = constr_min_h = constr_max_w = constr_max_h = true;
+
+   if (!al_set_window_constraints(
+	   display,
+	   constr_min_w ? min_w : 0,
+	   constr_min_h ? min_h : 0,
+	   constr_max_w ? max_w : 0,
+	   constr_max_h ? max_h : 0)) {
+		   abort_example("Unable to set window constrains\n");
+		   return -1;
+   }
+
    al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP);
    bmp = al_load_bitmap("data/mysha.pcx");
    if (!bmp) {
@@ -52,21 +68,7 @@
       return 1;
    }
 
-   min_w = 640;
-   min_h = 480;
-   max_w = 800;
-   max_h = 600;
-   constr_min_w = constr_min_h = constr_max_w = constr_max_h = true;
 
-    if (!al_set_window_constraints(
-          display,
-          constr_min_w ? min_w : 0,
-          constr_min_h ? min_h : 0,
-          constr_max_w ? max_w : 0,
-          constr_max_h ? max_h : 0)) {
-      abort_example("Unable to set window constrains\n");
-      return -1;
-   }
 
    queue = al_create_event_queue();
    al_register_event_source(queue, al_get_display_event_source(display));
