Commit b066f342 authored by Steven Fuller's avatar Steven Fuller

Added code to change mouse pointer in X ports

parent 53a96e5c
......@@ -40,12 +40,15 @@ int main(int argc, char *argv[])
/* TODO: move this to the proper functions */
XSetWindowAttributes attr;
XVisualInfo vitemp;
XSizeHints sizehints;
XGCValues gcvalues;
Pixmap bitmap;
Cursor cursor;
XColor bg = { 0 };
XColor fg = { 0 };
char data[8] = { 0x01 };
char *disp, *ext;
int attrmask, numVisuals, i;
int attrmask, i;
int major, minor;
disp = getenv("DISPLAY");
......@@ -120,13 +123,16 @@ int main(int argc, char *argv[])
XSetWMProperties(dpy, win, NULL, NULL, argv, argc, &sizehints, None, None);
/* TODO: have some global identifier for each game type */
XStoreName(dpy, win, GAMENAME);
XSetIconName(dpy, win, GAMENAME);
wmDeleteWindow = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
XSetWMProtocols(dpy, win, &wmDeleteWindow, 1);
bitmap = XCreateBitmapFromData(dpy, win, data, 8, 8);
cursor = XCreatePixmapCursor(dpy, bitmap, bitmap, &fg, &bg, 0, 0);
XDefineCursor(dpy, win, cursor);
XFlush(dpy);
glXMakeCurrent(dpy, win, ctx);
......
......@@ -33,6 +33,11 @@ int main(int argc, char *argv[])
XVisualInfo vitemp;
XSizeHints sizehints;
XGCValues gcvalues;
Pixmap bitmap;
Cursor cursor;
XColor bg = { 0 };
XColor fg = { 0 };
char data[8] = { 0x01 };
char *disp;
int attrmask, numVisuals, i;
......@@ -69,8 +74,6 @@ int main(int argc, char *argv[])
clr[i].pixel = i;
clr[i].flags = DoRed|DoGreen|DoBlue;
}
//XQueryColors(dpy, DefaultColormap(dpy, screen), clr, 256);
//XStoreColors(dpy, cmap, clr, 256);
attr.colormap = cmap;
attr.event_mask = KeyPressMask | KeyReleaseMask | ExposureMask;
......@@ -82,7 +85,6 @@ int main(int argc, char *argv[])
Quit("Unable to create window!");
}
gcvalues.foreground = BlackPixel(dpy, screen);
gcvalues.background = WhitePixel(dpy, screen);
gc = XCreateGC(dpy, win, GCForeground | GCBackground, &gcvalues);
......@@ -97,13 +99,16 @@ int main(int argc, char *argv[])
XSetWMProperties(dpy, win, NULL, NULL, argv, argc, &sizehints, None, None);
/* TODO: have some global identifier for each game type */
XStoreName(dpy, win, GAMENAME);
XSetIconName(dpy, win, GAMENAME);
wmDeleteWindow = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
XSetWMProtocols(dpy, win, &wmDeleteWindow, 1);
bitmap = XCreateBitmapFromData(dpy, win, data, 8, 8);
cursor = XCreatePixmapCursor(dpy, bitmap, bitmap, &fg, &bg, 0, 0);
XDefineCursor(dpy, win, cursor);
XFlush(dpy);
return WolfMain(argc, argv);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment