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
ae9119f8
Commit
ae9119f8
authored
Jul 27, 2007
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Jul 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wgl: Fix another BadMatch error by giving a pbuffer its own GLXContext.
parent
7d8c3107
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
23 deletions
+24
-23
opengl.c
dlls/winex11.drv/opengl.c
+24
-23
No files found.
dlls/winex11.drv/opengl.c
View file @
ae9119f8
...
...
@@ -81,26 +81,6 @@ typedef struct wine_glcontext {
struct
wine_glcontext
*
prev
;
}
Wine_GLContext
;
typedef
struct
wine_glpbuffer
{
Drawable
drawable
;
Display
*
display
;
int
pixelFormat
;
int
width
;
int
height
;
int
*
attribList
;
HDC
hdc
;
int
use_render_texture
;
GLuint
texture_target
;
GLuint
texture_bind_target
;
GLuint
texture
;
int
texture_level
;
HDC
prev_hdc
;
HGLRC
prev_ctx
;
HDC
render_hdc
;
HGLRC
render_ctx
;
}
Wine_GLPBuffer
;
typedef
struct
wine_glextension
{
const
char
*
extName
;
struct
{
...
...
@@ -134,6 +114,22 @@ typedef struct wine_glpixelformat {
BOOL
offscreenOnly
;
}
WineGLPixelFormat
;
typedef
struct
wine_glpbuffer
{
Drawable
drawable
;
Display
*
display
;
WineGLPixelFormat
*
fmt
;
int
width
;
int
height
;
int
*
attribList
;
HDC
hdc
;
int
use_render_texture
;
GLuint
texture_target
;
GLuint
texture_bind_target
;
GLuint
texture
;
int
texture_level
;
}
Wine_GLPBuffer
;
static
Wine_GLContext
*
context_list
;
static
struct
WineGLInfo
WineGLInfo
=
{
0
};
static
int
use_render_texture_emulation
=
1
;
...
...
@@ -1984,7 +1980,7 @@ static HPBUFFERARB WINAPI X11DRV_wglCreatePbufferARB(HDC hdc, int iPixelFormat,
object
->
display
=
gdi_display
;
object
->
width
=
iWidth
;
object
->
height
=
iHeight
;
object
->
pixelFormat
=
iPixelForma
t
;
object
->
fmt
=
fm
t
;
nAttribs
=
ConvertAttribWGLtoGLX
(
piAttribList
,
attribs
,
object
);
if
(
-
1
==
nAttribs
)
{
...
...
@@ -2163,7 +2159,7 @@ HDC X11DRV_wglGetPbufferDCARB(X11DRV_PDEVICE *physDev, HPBUFFERARB hPbuffer)
/* The function wglGetPbufferDCARB returns a DC to which the pbuffer can be connected.
* All formats in our pixelformat list are compatible with each other and the main drawable. */
physDev
->
current_pf
=
object
->
p
ixelFormat
;
physDev
->
current_pf
=
object
->
fmt
->
iP
ixelFormat
;
physDev
->
drawable
=
object
->
drawable
;
SetRect
(
&
physDev
->
drawable_rect
,
0
,
0
,
object
->
width
,
object
->
height
);
physDev
->
dc_rect
=
physDev
->
drawable_rect
;
...
...
@@ -2648,6 +2644,7 @@ static GLboolean WINAPI X11DRV_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuf
static
int
init
=
0
;
GLXContext
prev_context
=
pglXGetCurrentContext
();
Drawable
prev_drawable
=
pglXGetCurrentDrawable
();
GLXContext
tmp_context
;
/* Our render_texture emulation is basic and lacks some features (1D/Cube support).
This is mostly due to lack of demos/games using them. Further the use of glReadPixels
...
...
@@ -2664,14 +2661,18 @@ static GLboolean WINAPI X11DRV_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuf
return
GL_FALSE
;
}
TRACE
(
"drawable=%p, context=%p
\n
"
,
(
void
*
)
object
->
drawable
,
prev_context
);
tmp_context
=
pglXCreateNewContext
(
gdi_display
,
object
->
fmt
->
fbconfig
,
GLX_RGBA_TYPE
,
NULL
,
True
);
/* Switch to our pbuffer and readback its contents */
pglXMakeCurrent
(
gdi_display
,
object
->
drawable
,
prev
_context
);
pglXMakeCurrent
(
gdi_display
,
object
->
drawable
,
tmp
_context
);
pglReadPixels
(
0
,
0
,
object
->
width
,
object
->
height
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
buf
);
/* Switch back to the original drawable and upload the pbuffer-texture */
pglXMakeCurrent
(
object
->
display
,
prev_drawable
,
prev_context
);
pglTexImage2D
(
object
->
texture_target
,
0
,
GL_RGBA8
,
object
->
width
,
object
->
height
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
buf
);
pglXDestroyContext
(
gdi_display
,
tmp_context
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
...
...
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