d3d1x: stop using GLX in demos, just use the default visual
authorLuca Barbieri <luca@luca-barbieri.com>
Fri, 24 Sep 2010 13:01:04 +0000 (15:01 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Fri, 24 Sep 2010 13:12:19 +0000 (15:12 +0200)
src/gallium/state_trackers/d3d1x/progs/Makefile
src/gallium/state_trackers/d3d1x/progs/d3d10app/d3d10x11main.cpp
src/gallium/state_trackers/d3d1x/progs/d3d11app/d3d11x11main.cpp

index 4766d3684d04ecec2bda561020d0cf587bcc127c..bb37012a3d7bf62cb7ace7e3445414f73af22a92 100644 (file)
@@ -13,7 +13,7 @@ LIBS= \
        ../../../../../lib/libEGL.so
 LIBS_D3D10 = ../dxgid3d10/libdxgid3d10.a ../gd3d10/libgd3d10.a $(LIBS)
 LIBS_D3D11 = ../dxgid3d11/libdxgid3d11.a ../gd3d11/libgd3d11.a $(LIBS)
-LDADD=-lGL -lXext -lXfixes -lX11 -ldrm -ldl
+LDADD=-lXext -lXfixes -lX11 -ldrm -ldl
 
 all: bin/d3d10tri bin/d3d11tri bin/d3d11tex bin/d3d11gears
 include ../Makefile.inc
index a8f24ae3031f535206f479e65ff823e402dd5994..efbe322fe68942b02e4f1991f561ad375365ef8f 100755 (executable)
@@ -26,7 +26,6 @@
 \r
 #include "d3d10app.h"\r
 #include <X11/Xlib.h>\r
-#include <GL/glx.h>\r
 #include <galliumdxgi.h>\r
 #include <sys/time.h>\r
 \r
@@ -37,14 +36,6 @@ DXGI_FORMAT format = DXGI_FORMAT_R8G8B8A8_UNORM;
 static ID3D10Device* dev;\r
 static ID3D10Device* ctx;\r
 \r
-static int attributeList[] = {\r
-               GLX_RGBA,\r
-               GLX_RED_SIZE, 8,\r
-               GLX_GREEN_SIZE, 8,\r
-               GLX_BLUE_SIZE, 8,\r
-               None\r
-};\r
-\r
 double get_time()\r
 {\r
        struct timeval tv;\r
@@ -55,15 +46,15 @@ double get_time()
 int main(int argc, char** argv)\r
 {\r
        Display* dpy = XOpenDisplay(0);\r
-       XVisualInfo* vi = glXChooseVisual(dpy, DefaultScreen(dpy), attributeList);\r
-       Colormap cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone);\r
+       Visual* visual = DefaultVisual(dpy, DefaultScreen(dpy));\r
+       Colormap cmap = XCreateColormap(dpy, RootWindow(dpy, DefaultScreen(dpy)), visual, AllocNone);\r
        XSetWindowAttributes swa;\r
        swa.colormap = cmap;\r
        swa.border_pixel = 0;\r
        swa.event_mask = StructureNotifyMask;\r
        width = 512;\r
        height = 512;\r
-       Window win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap| CWEventMask, &swa);\r
+       Window win = XCreateWindow(dpy, RootWindow(dpy, DefaultScreen(dpy)), 0, 0, width, height, 0, CopyFromParent, InputOutput, visual, CWBorderPixel | CWColormap| CWEventMask, &swa);\r
        XMapWindow(dpy, win);\r
 \r
        GalliumDXGIUseX11Display(dpy, 0);\r
index 8eb51d3638719cf43ae341f55b6d7a0f1241e799..1271499c4d3403e4dc662a9890824842ab0e5a9e 100755 (executable)
@@ -1,6 +1,5 @@
 #include "d3d11app.h"\r
 #include <X11/Xlib.h>\r
-#include <GL/glx.h>\r
 #include <galliumdxgi.h>\r
 #include <sys/time.h>\r
 \r
@@ -11,14 +10,6 @@ DXGI_FORMAT format = DXGI_FORMAT_R8G8B8A8_UNORM;
 static ID3D11Device* dev;\r
 static ID3D11DeviceContext* ctx;\r
 \r
-static int attributeList[] = {\r
-               GLX_RGBA,\r
-               GLX_RED_SIZE, 8,\r
-               GLX_GREEN_SIZE, 8,\r
-               GLX_BLUE_SIZE, 8,\r
-               None\r
-};\r
-\r
 double get_time()\r
 {\r
        struct timeval tv;\r
@@ -29,15 +20,15 @@ double get_time()
 int main(int argc, char** argv)\r
 {\r
        Display* dpy = XOpenDisplay(0);\r
-       XVisualInfo* vi = glXChooseVisual(dpy, DefaultScreen(dpy), attributeList);\r
-       Colormap cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone);\r
+       Visual* visual = DefaultVisual(dpy, DefaultScreen(dpy));\r
+       Colormap cmap = XCreateColormap(dpy, RootWindow(dpy, DefaultScreen(dpy)), visual, AllocNone);\r
        XSetWindowAttributes swa;\r
        swa.colormap = cmap;\r
        swa.border_pixel = 0;\r
        swa.event_mask = StructureNotifyMask;\r
        width = 512;\r
        height = 512;\r
-       Window win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap| CWEventMask, &swa);\r
+       Window win = XCreateWindow(dpy, RootWindow(dpy, DefaultScreen(dpy)), 0, 0, width, height, 0, CopyFromParent, InputOutput, visual, CWBorderPixel | CWColormap| CWEventMask, &swa);\r
        XMapWindow(dpy, win);\r
 \r
        GalliumDXGIUseX11Display(dpy, 0);\r