+/* 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>
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),
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;