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
b9efc4d2
Commit
b9efc4d2
authored
Jul 22, 2005
by
Oliver Stieber
Committed by
Alexandre Julliard
Jul 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow running opengl and DirectX applications without stencil support,
an earlier patch assumed that stencil support was available, but it isn't in all cases.
parent
6b4c9ef2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
13 deletions
+39
-13
opengl.c
dlls/x11drv/opengl.c
+39
-13
No files found.
dlls/x11drv/opengl.c
View file @
b9efc4d2
...
@@ -122,6 +122,7 @@ MAKE_FUNCPTR(glXQueryExtension)
...
@@ -122,6 +122,7 @@ MAKE_FUNCPTR(glXQueryExtension)
MAKE_FUNCPTR
(
glXGetFBConfigs
)
MAKE_FUNCPTR
(
glXGetFBConfigs
)
MAKE_FUNCPTR
(
glXChooseFBConfig
)
MAKE_FUNCPTR
(
glXChooseFBConfig
)
MAKE_FUNCPTR
(
glXGetFBConfigAttrib
)
MAKE_FUNCPTR
(
glXGetFBConfigAttrib
)
MAKE_FUNCPTR
(
glXGetVisualFromFBConfig
)
#undef MAKE_FUNCPTR
#undef MAKE_FUNCPTR
static
BOOL
has_opengl
(
void
)
static
BOOL
has_opengl
(
void
)
...
@@ -147,6 +148,7 @@ LOAD_FUNCPTR(glXQueryExtension)
...
@@ -147,6 +148,7 @@ LOAD_FUNCPTR(glXQueryExtension)
LOAD_FUNCPTR
(
glXGetFBConfigs
)
LOAD_FUNCPTR
(
glXGetFBConfigs
)
LOAD_FUNCPTR
(
glXChooseFBConfig
)
LOAD_FUNCPTR
(
glXChooseFBConfig
)
LOAD_FUNCPTR
(
glXGetFBConfigAttrib
)
LOAD_FUNCPTR
(
glXGetFBConfigAttrib
)
LOAD_FUNCPTR
(
glXGetVisualFromFBConfig
)
#undef LOAD_FUNCPTR
#undef LOAD_FUNCPTR
wine_tsx11_lock
();
wine_tsx11_lock
();
...
@@ -475,25 +477,49 @@ XVisualInfo *X11DRV_setup_opengl_visual( Display *display )
...
@@ -475,25 +477,49 @@ XVisualInfo *X11DRV_setup_opengl_visual( Display *display )
{
{
XVisualInfo
*
visual
=
NULL
;
XVisualInfo
*
visual
=
NULL
;
/* In order to support OpenGL or D3D, we require a double-buffered visual and stencil buffer support, */
/* In order to support OpenGL or D3D, we require a double-buffered visual and stencil buffer support, */
int
dblBuf
[]
=
{
GLX_RGBA
,
GLX_DEPTH_SIZE
,
16
,
GLX_STENCIL_SIZE
,
8
,
GLX_DOUBLEBUFFER
,
None
};
int
dblBuf
[]
=
{
GLX_DRAWABLE_TYPE
,
GLX_PBUFFER_BIT
|
GLX_WINDOW_BIT
,
GLX_RENDER_TYPE
,
GLX_RGBA_BIT
,
GLX_DEPTH_SIZE
,
16
,
GLX_DOUBLEBUFFER
,
TRUE
,
None
};
int
nCfgs
;
unsigned
int
i
;
int
maxStencil
=
-
1
;
int
attribSize
;
GLXFBConfig
*
cfgs
=
NULL
;
GLXFBConfig
*
chosenCfg
=
NULL
;
if
(
!
has_opengl
())
return
NULL
;
if
(
!
has_opengl
())
return
NULL
;
wine_tsx11_lock
();
wine_tsx11_lock
();
visual
=
pglXChooseVisual
(
display
,
DefaultScreen
(
display
),
dblBuf
);
wine_tsx11_unlock
();
if
(
visual
==
NULL
)
{
/* fallback to a 1 bit stencil (opengl states that at least 1 bit of stencil must be provided for on of the available configurations) */
int
dblBuf2
[]
=
{
GLX_RGBA
,
GLX_DEPTH_SIZE
,
16
,
GLX_STENCIL_SIZE
,
1
,
GLX_DOUBLEBUFFER
,
None
};
WARN
(
"Failed to get a visual with at least 8 bits of stencil
\n
"
);
wine_tsx11_lock
();
/* Fint the config with the highest stencil buffer size */
visual
=
pglXChooseVisual
(
display
,
DefaultScreen
(
display
),
dblBuf2
);
cfgs
=
pglXChooseFBConfig
(
display
,
DefaultScreen
(
display
),
dblBuf
,
&
nCfgs
);
wine_tsx11_unlock
();
if
(
cfgs
==
NULL
)
{
if
(
visual
==
NULL
)
{
WARN
(
"Couldn't find a double buffered, RGBA visual with 16 bits depth
\n
"
);
/* This should only happen if we cannot fidn a match with a depth size 16 */
visual
=
NULL
;
FIXME
(
"Failed to find a suitable visual
\n
"
);
}
else
{
for
(
i
=
0
;
i
<
nCfgs
;
++
i
)
{
pglXGetFBConfigAttrib
(
display
,
cfgs
[
i
],
GLX_STENCIL_SIZE
,
&
attribSize
);
if
(
attribSize
>
maxStencil
)
{
chosenCfg
=
cfgs
+
i
;
maxStencil
=
attribSize
;
}
}
}
pglXGetFBConfigAttrib
(
display
,
*
chosenCfg
,
GLX_RED_SIZE
,
&
attribSize
);
TRACE
(
"A FB config with RED %d"
,
attribSize
);
pglXGetFBConfigAttrib
(
display
,
*
chosenCfg
,
GLX_GREEN_SIZE
,
&
attribSize
);
TRACE
(
" GREEN %d"
,
attribSize
);
pglXGetFBConfigAttrib
(
display
,
*
chosenCfg
,
GLX_BLUE_SIZE
,
&
attribSize
);
TRACE
(
" BLUE %d"
,
attribSize
);
pglXGetFBConfigAttrib
(
display
,
*
chosenCfg
,
GLX_ALPHA_SIZE
,
&
attribSize
);
TRACE
(
" ALPHA %d"
,
attribSize
);
pglXGetFBConfigAttrib
(
display
,
*
chosenCfg
,
GLX_DEPTH_SIZE
,
&
attribSize
);
TRACE
(
" DEPTH %d"
,
attribSize
);
pglXGetFBConfigAttrib
(
display
,
*
chosenCfg
,
GLX_STENCIL_SIZE
,
&
attribSize
);
TRACE
(
" STENCIL %d has been chosen
\n
"
,
attribSize
);
visual
=
pglXGetVisualFromFBConfig
(
display
,
*
chosenCfg
);
XFree
(
cfgs
);
}
}
wine_tsx11_unlock
();
return
visual
;
return
visual
;
}
}
...
...
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