Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wolf3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
wolf3d
Commits
b066f342
Commit
b066f342
authored
Apr 27, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added code to change mouse pointer in X ports
parent
53a96e5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
vi_glx.c
src/vi_glx.c
+11
-5
vi_xlib.c
src/vi_xlib.c
+9
-4
No files found.
src/vi_glx.c
View file @
b066f342
...
...
@@ -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
);
...
...
src/vi_xlib.c
View file @
b066f342
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment