add {glx,egl}2test using the GL2 API in a classic OpenGL context
[gltest.git] / glwindow.cpp
index 67e9b9a2f5d72843d67e27cd3e90eb962d8813be..ca6dbb95018d91fa416360a542fe32edc1c0ac33 100644 (file)
@@ -1,3 +1,21 @@
+/* gltest - small OpenGL tearing test program
+ * Copyright (C) 2012-2013 Ralf Jung <post@ralfj.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
 #include "glwindow.h"
 
 #include <assert.h>
@@ -28,22 +46,6 @@ void GLWindow::create(unsigned int width, unsigned int height)
        winAttr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask | StructureNotifyMask;                                                 
        winAttr.border_pixel = 0;
        // create window
-       /*if (fullscreen) {
-               // get root window size
-               width = DisplayWidth(display, vi->screen);
-               height = DisplayHeight(display, vi->screen);
-               printf("Display size: %dx%d\n", width, height);
-               // set window attributes
-               winAttr.override_redirect = True;
-               window = XCreateWindow(display, RootWindow(display, vi->screen),
-                       0, 0, width, height, 0, vi->depth, InputOutput, vi->visual,
-                       CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect, &winAttr);
-               XWarpPointer(display, None, window, 0, 0, 0, 0, 0, 0);
-               XMapRaised(display, window);
-               XGrabKeyboard(display, window, True, GrabModeAsync, GrabModeAsync, CurrentTime);
-               XGrabPointer(display, window, True, ButtonPressMask, GrabModeAsync, GrabModeAsync, window, None, CurrentTime);
-       }
-       else {*/
        printf("Initial window size: %dx%d\n", width, height);
        // create a window in window mode
        window = XCreateWindow(display, RootWindow(display, vi->screen),
@@ -122,8 +124,6 @@ void GLWindow::exec()
                                        if (strcmp(XGetAtomName(display, event.xclient.message_type), "WM_PROTOCOLS") == 0 &&
                                                strcmp(XGetAtomName(display, event.xclient.data.l[0]), "WM_DELETE_WINDOW") == 0)
                                        {
-                                               XDestroyWindow(display, window);
-                                               window = 0;
                                                return;
                                        }
                                        break;