Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
df6cd82c
Commit
df6cd82c
authored
May 06, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Create a window of the appropriate visual to initialize GL info.
parent
e45926d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
+25
-12
opengl.c
dlls/winex11.drv/opengl.c
+25
-12
No files found.
dlls/winex11.drv/opengl.c
View file @
df6cd82c
...
...
@@ -297,16 +297,21 @@ static BOOL infoInitialized = FALSE;
static
BOOL
X11DRV_WineGL_InitOpenglInfo
(
void
)
{
int
screen
=
DefaultScreen
(
gdi_display
);
Window
win
=
RootWindow
(
gdi_display
,
screen
)
;
Window
win
=
0
,
root
=
0
;
const
char
*
str
;
XVisualInfo
*
vis
;
GLXContext
ctx
=
NULL
;
XSetWindowAttributes
attr
;
BOOL
ret
=
FALSE
;
int
attribList
[]
=
{
GLX_RGBA
,
GLX_DOUBLEBUFFER
,
None
};
if
(
infoInitialized
)
return
TRUE
;
infoInitialized
=
TRUE
;
attr
.
override_redirect
=
True
;
attr
.
colormap
=
None
;
wine_tsx11_lock
();
vis
=
pglXChooseVisual
(
gdi_display
,
screen
,
attribList
);
...
...
@@ -318,23 +323,26 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void)
if
(
wine_get_fs
()
!=
old_fs
)
{
wine_set_fs
(
old_fs
);
wine_tsx11_unlock
();
ERR
(
"%%fs register corrupted, probably broken ATI driver, disabling OpenGL.
\n
"
);
ERR
(
"You need to set the
\"
UseFastTls
\"
option to
\"
2
\"
in your X config file.
\n
"
);
return
FALSE
;
goto
done
;
}
#else
ctx
=
pglXCreateContext
(
gdi_display
,
vis
,
None
,
GL_TRUE
);
#endif
}
if
(
!
ctx
)
goto
done
;
if
(
ctx
)
{
pglXMakeCurrent
(
gdi_display
,
win
,
ctx
);
}
else
{
ERR
(
" couldn't initialize OpenGL, expect problems
\n
"
);
wine_tsx11_unlock
();
return
FALSE
;
}
root
=
RootWindow
(
gdi_display
,
vis
->
screen
);
if
(
vis
->
visual
!=
DefaultVisual
(
gdi_display
,
vis
->
screen
))
attr
.
colormap
=
XCreateColormap
(
gdi_display
,
root
,
vis
->
visual
,
AllocNone
);
if
((
win
=
XCreateWindow
(
gdi_display
,
root
,
-
1
,
-
1
,
1
,
1
,
0
,
vis
->
depth
,
InputOutput
,
vis
->
visual
,
CWOverrideRedirect
|
CWColormap
,
&
attr
)))
XMapWindow
(
gdi_display
,
win
);
else
win
=
root
;
pglXMakeCurrent
(
gdi_display
,
win
,
ctx
);
WineGLInfo
.
glVersion
=
(
const
char
*
)
pglGetString
(
GL_VERSION
);
str
=
(
const
char
*
)
pglGetString
(
GL_EXTENSIONS
);
...
...
@@ -391,14 +399,19 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void)
if
(
!
strcmp
(
gl_renderer
,
"Software Rasterizer"
)
||
!
strcmp
(
gl_renderer
,
"Mesa X11"
))
ERR_
(
winediag
)(
"The Mesa OpenGL driver is using software rendering, most likely your OpenGL drivers haven't been installed correctly
\n
"
);
}
ret
=
TRUE
;
done:
if
(
vis
)
XFree
(
vis
);
if
(
ctx
)
{
pglXMakeCurrent
(
gdi_display
,
None
,
NULL
);
pglXDestroyContext
(
gdi_display
,
ctx
);
}
if
(
win
!=
root
)
XDestroyWindow
(
gdi_display
,
win
);
if
(
attr
.
colormap
)
XFreeColormap
(
gdi_display
,
attr
.
colormap
);
wine_tsx11_unlock
();
return
TRUE
;
if
(
!
ret
)
ERR
(
" couldn't initialize OpenGL, expect problems
\n
"
);
return
ret
;
}
void
X11DRV_OpenGL_Cleanup
(
void
)
...
...
@@ -891,7 +904,7 @@ static int get_render_type_from_fbconfig(Display *display, GLXFBConfig fbconfig)
render_type
=
GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT
;
break
;
default:
ERR
(
"Unknown render_type: %x
\n
"
,
render_type
);
ERR
(
"Unknown render_type: %x
\n
"
,
render_type
_bit
);
}
return
render_type
;
}
...
...
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