summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-03-26 14:17:31 +0000
committerBrian Paul <[email protected]>2004-03-26 14:17:31 +0000
commit68b38d275117182f416c9f2afdcae6135bffa0dd (patch)
tree03f348df234f6cf94650e459896dd878bb39b24c
parent3623579e43b4c3a8d2eb7edb6efaa6f178279ec9 (diff)
check for GLX 1.3 during init
-rw-r--r--progs/xdemos/wincopy.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/progs/xdemos/wincopy.c b/progs/xdemos/wincopy.c
index 3093553d5de..e3516e15229 100644
--- a/progs/xdemos/wincopy.c
+++ b/progs/xdemos/wincopy.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -38,6 +38,7 @@
#include <X11/keysym.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
@@ -247,6 +248,7 @@ Init(void)
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
None };
+ int major, minor;
Dpy = XOpenDisplay(NULL);
if (!Dpy) {
@@ -256,6 +258,12 @@ Init(void)
ScrNum = DefaultScreen(Dpy);
+ glXQueryVersion(Dpy, &major, &minor);
+ if (major * 100 + minor < 103) {
+ fprintf(stderr, "Sorry, this program requires GLX 1.3\n");
+ exit(1);
+ }
+
visinfo = glXChooseVisual(Dpy, ScrNum, attrib);
if (!visinfo) {
printf("Unable to find RGB, double-buffered visual\n");