X-Git-Url: https://git.ralfj.de/gltest.git/blobdiff_plain/aa4575e1aa768daff8ca10c7a8a06aa0603e998f..HEAD:/glwindow.cpp diff --git a/glwindow.cpp b/glwindow.cpp index 67e9b9a..ca6dbb9 100644 --- a/glwindow.cpp +++ b/glwindow.cpp @@ -1,3 +1,21 @@ +/* gltest - small OpenGL tearing test program + * Copyright (C) 2012-2013 Ralf Jung + * + * 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 @@ -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;