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
069dd51e
Commit
069dd51e
authored
Apr 11, 2002
by
Christoph Frick
Committed by
Alexandre Julliard
Apr 11, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse visuals to avoid MAX_PIXELFORMATS limit.
Activated the code to support the stencil buffer.
parent
6aadb22b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
opengl.c
graphics/x11drv/opengl.c
+23
-12
No files found.
graphics/x11drv/opengl.c
View file @
069dd51e
...
...
@@ -94,6 +94,7 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev,
int
att_list
[
64
];
int
att_pos
=
0
;
XVisualInfo
*
vis
;
int
i
;
if
(
TRACE_ON
(
opengl
))
{
TRACE
(
"(%p,%p)
\n
"
,
physDev
,
ppfd
);
...
...
@@ -101,14 +102,6 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev,
dump_PIXELFORMATDESCRIPTOR
((
PIXELFORMATDESCRIPTOR
*
)
ppfd
);
}
/* For the moment, we are dumb : we always allocate a new XVisualInfo structure,
we do not try to find an already found that could match */
if
(
physDev
->
used_visuals
==
MAX_PIXELFORMATS
)
{
ERR
(
"Maximum number of visuals reached !
\n
"
);
/* Should SetError here... */
return
0
;
}
if
(
ppfd
->
dwFlags
&
PFD_DRAW_TO_BITMAP
)
{
ERR
(
"Flag not supported !
\n
"
);
/* Should SetError here... */
...
...
@@ -125,9 +118,9 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev,
/* These flags are not supported yet...
NULL_TEST_AND_ADD2(ppfd->cAlphaBits, GLX_ALPHA_SIZE, 8);
ADD2(GLX_ACCUM_SIZE, ppfd->cAccumBits);
ADD2(GLX_STENCIL_SIZE, ppfd->cStencilBits);
ADD2(GLX_AUX_BUFFERS, ppfd->cAuxBuffers); */
ADD2(GLX_ACCUM_SIZE, ppfd->cAccumBits);
*/
ADD2
(
GLX_STENCIL_SIZE
,
ppfd
->
cStencilBits
);
/* now suported */
/*
ADD2(GLX_AUX_BUFFERS, ppfd->cAuxBuffers); */
att_list
[
att_pos
]
=
None
;
ENTER_GL
();
{
...
...
@@ -152,6 +145,19 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev,
/* Should SetError here... */
return
0
;
}
/* try to find the visualid in the already created visuals */
for
(
i
=
0
;
i
<
physDev
->
used_visuals
;
i
++
)
{
if
(
vis
->
visualid
==
physDev
->
visuals
[
i
]
->
visualid
)
{
XFree
(
vis
);
return
i
+
1
;
}
}
/* now give up, if the maximum is reached */
if
(
physDev
->
used_visuals
==
MAX_PIXELFORMATS
)
{
ERR
(
"Maximum number of visuals reached !
\n
"
);
/* Should SetError here... */
return
0
;
}
physDev
->
visuals
[
physDev
->
used_visuals
++
]
=
vis
;
return
physDev
->
used_visuals
;
...
...
@@ -256,9 +262,14 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev,
/* Depth bits */
glXGetConfig
(
gdi_display
,
vis
,
GLX_DEPTH_SIZE
,
&
value
);
ppfd
->
cDepthBits
=
value
;
/* stencil bits */
glXGetConfig
(
gdi_display
,
vis
,
GLX_STENCIL_SIZE
,
&
value
);
ppfd
->
cStencilBits
=
value
;
LEAVE_GL
();
/* Aux
, stencil
: to do ... */
/* Aux : to do ... */
ppfd
->
iLayerType
=
PFD_MAIN_PLANE
;
...
...
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