mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-05 06:28:17 +02:00
d3d1x: stop using GLX in demos, just use the default visual
This commit is contained in:
parent
db1fbb1efc
commit
7e81c67c8b
3 changed files with 7 additions and 25 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "d3d10app.h"
|
||||
#include <X11/Xlib.h>
|
||||
#include <GL/glx.h>
|
||||
#include <galliumdxgi.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
|
|
@ -37,14 +36,6 @@ DXGI_FORMAT format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
|||
static ID3D10Device* dev;
|
||||
static ID3D10Device* ctx;
|
||||
|
||||
static int attributeList[] = {
|
||||
GLX_RGBA,
|
||||
GLX_RED_SIZE, 8,
|
||||
GLX_GREEN_SIZE, 8,
|
||||
GLX_BLUE_SIZE, 8,
|
||||
None
|
||||
};
|
||||
|
||||
double get_time()
|
||||
{
|
||||
struct timeval tv;
|
||||
|
|
@ -55,15 +46,15 @@ double get_time()
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
Display* dpy = XOpenDisplay(0);
|
||||
XVisualInfo* vi = glXChooseVisual(dpy, DefaultScreen(dpy), attributeList);
|
||||
Colormap cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone);
|
||||
Visual* visual = DefaultVisual(dpy, DefaultScreen(dpy));
|
||||
Colormap cmap = XCreateColormap(dpy, RootWindow(dpy, DefaultScreen(dpy)), visual, AllocNone);
|
||||
XSetWindowAttributes swa;
|
||||
swa.colormap = cmap;
|
||||
swa.border_pixel = 0;
|
||||
swa.event_mask = StructureNotifyMask;
|
||||
width = 512;
|
||||
height = 512;
|
||||
Window win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap| CWEventMask, &swa);
|
||||
Window win = XCreateWindow(dpy, RootWindow(dpy, DefaultScreen(dpy)), 0, 0, width, height, 0, CopyFromParent, InputOutput, visual, CWBorderPixel | CWColormap| CWEventMask, &swa);
|
||||
XMapWindow(dpy, win);
|
||||
|
||||
GalliumDXGIUseX11Display(dpy, 0);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "d3d11app.h"
|
||||
#include <X11/Xlib.h>
|
||||
#include <GL/glx.h>
|
||||
#include <galliumdxgi.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
|
|
@ -11,14 +10,6 @@ DXGI_FORMAT format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
|||
static ID3D11Device* dev;
|
||||
static ID3D11DeviceContext* ctx;
|
||||
|
||||
static int attributeList[] = {
|
||||
GLX_RGBA,
|
||||
GLX_RED_SIZE, 8,
|
||||
GLX_GREEN_SIZE, 8,
|
||||
GLX_BLUE_SIZE, 8,
|
||||
None
|
||||
};
|
||||
|
||||
double get_time()
|
||||
{
|
||||
struct timeval tv;
|
||||
|
|
@ -29,15 +20,15 @@ double get_time()
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
Display* dpy = XOpenDisplay(0);
|
||||
XVisualInfo* vi = glXChooseVisual(dpy, DefaultScreen(dpy), attributeList);
|
||||
Colormap cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone);
|
||||
Visual* visual = DefaultVisual(dpy, DefaultScreen(dpy));
|
||||
Colormap cmap = XCreateColormap(dpy, RootWindow(dpy, DefaultScreen(dpy)), visual, AllocNone);
|
||||
XSetWindowAttributes swa;
|
||||
swa.colormap = cmap;
|
||||
swa.border_pixel = 0;
|
||||
swa.event_mask = StructureNotifyMask;
|
||||
width = 512;
|
||||
height = 512;
|
||||
Window win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap| CWEventMask, &swa);
|
||||
Window win = XCreateWindow(dpy, RootWindow(dpy, DefaultScreen(dpy)), 0, 0, width, height, 0, CopyFromParent, InputOutput, visual, CWBorderPixel | CWColormap| CWEventMask, &swa);
|
||||
XMapWindow(dpy, win);
|
||||
|
||||
GalliumDXGIUseX11Display(dpy, 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue