[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: GetDC in ddraw
From:       Karl Lessard <oponvybl () umail ! corel ! com>
Date:       1999-09-27 14:26:04
[Download RAW message or body]

Lionel Ulmer wrote:
> 
> > The problem is that my app have to take control of the framebuffer via
> > DirectDraw, draw some images, and then give back the control to the
> > Xserver, and it do that really often.
> 
> Is this application supposed to do windowed DirectDraw or full screen
> access ? Anyway, I would love to see a -debugmsg +ddraw trace to have
> some more informations on what exactly is going on...

It does Full Screen access. Here's the debugmsgs your are intersted with:

trace:ddraw:DirectDrawCreate (<guid-0x00000000>,0x408e58d8,(nil))
trace:ddraw:Xlib_DirectDrawCreate Using XShm extension.
fixme:ddraw:IDirectDraw2Impl_SetCooperativeLevel
(0x408e5a2c)->(0000087c,00000011)
trace:ddraw:Xlib_IDirectDraw2Impl_GetCaps
(0x408e5a2c)->GetCaps(0x408bf3d8,(nil))
fixme:ddraw:IDirectDraw2Impl_SetCooperativeLevel
(0x408e5a2c)->(0000087c,00000011)
trace:ddraw:Xlib_IDirectDraw2Impl_CreateSurface
(0x408e5a2c)->CreateSurface(0x408e58fc,0x408e58dc,(nil))
 - DDSD_CAPS : DDSCAPS_COMPLEX DDSCAPS_FLIP DDSCAPS_PRIMARYSURFACE
 - DDSD_BACKBUFFERCOUNT : 1
trace:ddraw:IDirectDraw2Impl_AddRef (0x408e5a2c)->() incrementing from 1.
trace:ddraw:Xlib_IDirectDraw2Impl_CreateSurface using standard XImage for a
primary surface (0x408e5b00)
trace:ddraw:Xlib_IDirectDraw2Impl_CreateSurface allocated back-buffer
(0x408e5bbc)
trace:ddraw:IDirectDraw2Impl_AddRef (0x408e5a2c)->() incrementing from 2.
trace:ddraw:IDirectDrawSurface4Impl_AddRef (0x408e5b00)->() incrementing
from 1.
fixme:ddraw:IDirectDrawSurface4Impl_AddAttachedSurface
(0x408e5b00)->(0x408e5bbc)
trace:ddraw:IDirectDrawSurface4Impl_GetAttachedSurface
(0x408e5b00)->GetAttachedSurface(0x408e5968,0x408e58e0)
trace:ddraw:IDirectDrawSurface4Impl_GetAttachedSurface  caps
DDSCAPS_BACKBUFFER trace:ddraw:IDirectDrawSurface4Impl_GetAttachedSurface
found 0x408e5bbc
trace:ddraw:IDirectDrawSurface4Impl_Lock
(0x408e5bbc)->Lock((nil),0x408e58fc,00000001,00000000)
trace:ddraw:IDirectDrawSurface4Impl_Lock locked surface: height=768,
width=1024, pitch=2048
trace:ddraw:Xlib_IDirectDrawSurface4Impl_Unlock
(0x408e5bbc)->Unlock(0x41201000)
trace:ddraw:IDirectDrawSurface4Impl_GetSurfaceDesc
(0x408e5b00)->GetSurfaceDesc(0x408e58fc)             
 - DDSD_CAPS : DDSCAPS_COMPLEX DDSCAPS_FLIP DDSCAPS_FRONTBUFFER
DDSCAPS_PRIMARYSURFACE DDSCAPS_VIDEOMEMORY DDSCAPS_VISIBLE
 - DDSD_HEIGHT : 768
 - DDSD_WIDTH : 1024
 - DDSD_PITCH : 2048
 - DDSD_BACKBUFFERCOUNT : 1
 - DDSD_PIXELFORMAT : ( DDPF_RGB , RGB bits: 16,  R f800 G 07e0 B 001f)
 - DDSD_LPSURFACE : 0x41081000                         

(Here's, it starts drawing with GDI. Then, it use the results for the
following drawing:  )

trace:ddraw:Xlib_IDirectDraw2Impl_CreateSurface
(0x408e5a2c)->CreateSurface(0x40
8bf13c,0x408bf138,(nil))
 - DDSD_CAPS : DDSCAPS_OFFSCREENPLAIN
 - DDSD_HEIGHT : 768
 - DDSD_WIDTH : 1024
trace:ddraw:IDirectDraw2Impl_AddRef (0x408e5a2c)->() incrementing from 3.
trace:ddraw:common_off_screen_CreateSurface using system memory for a
surface (0
x408e9ef8)
fixme:ddraw:IDirectDraw2Impl_GetMonitorFrequency (0x408e5a2c)->(0x408bf420)
retu
rns 60 Hz always
fixme:ddraw:IDirectDrawSurface4Impl_GetDC (0x408e9ef8)->GetDC(0x408bf0c8)
trace:ddraw:IDirectDrawSurface4Impl_Lock
(0x408e9ef8)->Lock((nil),0x408bf038,000
00000,00000000)
trace:ddraw:IDirectDrawSurface4Impl_Lock locked surface: height=768,
width=1024,
 pitch=2048
trace:ddraw:IDirectDrawSurface4Impl_GetDC DIBSection at : 0x42530000
trace:ddraw:IDirectDrawSurface4Impl_GetDC HDC : 00001b68
fixme:ddraw:IDirectDrawSurface4Impl_ReleaseDC
(0x408e9ef8)->(0x00001b68),stub!
trace:ddraw:IDirectDrawSurface4Impl_ReleaseDC Copying DIBSection at :
0x42530000
trace:ddraw:Xlib_IDirectDrawSurface4Impl_Unlock
(0x408e9ef8)->Unlock(0x423a0028)
fixme:ddraw:IDirectDrawSurface4Impl_BltFast
(0x408e5bbc)->(22,0,0x408e5b00,0x408
bf3a0,00000010)
fixme:ddraw:IDirectDrawSurface4Impl_BltFast     trans:DDBLTFAST_WAIT
fixme:ddraw:IDirectDrawSurface4Impl_BltFast     srcrect: 0x0-1002x768
trace:ddraw:IDirectDrawSurface4Impl_Lock
(0x408e5b00)->Lock((nil),0x408bf0c8,000
00010,00000000)
trace:ddraw:IDirectDrawSurface4Impl_Lock locked surface: height=768,
width=1024,
 pitch=2048
trace:ddraw:IDirectDrawSurface4Impl_Lock
(0x408e5bbc)->Lock((nil),0x408bf134,000
00020,00000000)
trace:ddraw:IDirectDrawSurface4Impl_Lock locked surface: height=768,
width=1024,
 pitch=2048
trace:ddraw:Xlib_IDirectDrawSurface4Impl_Unlock
(0x408e5bbc)->Unlock(0x41201000)
trace:ddraw:Xlib_IDirectDrawSurface4Impl_Unlock
(0x408e5b00)->Unlock(0x41081000)
trace:ddraw:IDirectDrawSurface4Impl_Blt
(0x408e5bbc)->(0x408bf3b0,0x408e9ef8,0x4
08bf3cc,01000000,(nil))
trace:ddraw:IDirectDrawSurface4Impl_Lock
(0x408e9ef8)->Lock((nil),0x408befa4,000
00000,00000000)
trace:ddraw:IDirectDrawSurface4Impl_Lock locked surface: height=768,
width=1024,
 pitch=2048
trace:ddraw:IDirectDrawSurface4Impl_Lock
(0x408e5bbc)->Lock((nil),0x408bf010,000
00000,00000000)
trace:ddraw:IDirectDrawSurface4Impl_Lock locked surface: height=768,
width=1024,
 pitch=2048
trace:ddraw:IDirectDrawSurface4Impl_Blt         destrect :0x0-22x768
trace:ddraw:IDirectDrawSurface4Impl_Blt         srcrect  :1002x0-1024x768
trace:ddraw:IDirectDrawSurface4Impl_Blt         flags: DDBLT_WAIT
trace:ddraw:Xlib_IDirectDrawSurface4Impl_Unlock
(0x408e5bbc)->Unlock(0x41201000)
trace:ddraw:Xlib_IDirectDrawSurface4Impl_Unlock
(0x408e9ef8)->Unlock(0x423a0028)
trace:ddraw:Xlib_IDirectDrawSurface4Impl_Flip
(0x408e5b00)->Flip((nil),00000001)
trace:ddraw:_common_find_flipto flipping to
0x408e5bbc                          

(what it does is creating a OffScreenSurface, 
get a DC from it, 
set the image in it through a GDI blt call, 
release the DC, 
copy a section of the current displayed image in the backbuffer using the
primary surface with a BltFast call,
fill the empty section of the backbuffered image with the image from the
offscreen surface,
flip)



     
> 
> > If I use Xlib interface, I have the following problem:
> > my app creates at the beginning a ddraw primary surface. It draws things
> > through GDI, and then it starts to draw with DDraw, getting data from the
> > primary surface, which is supposed to link to the current displayed image.
> 
> The app draws through GDI using the DC that it got from a GetDC call ?

In some cases, that's what it does, but in another cases, it just draws
images with GDI without any calls to DDraw, and later, it use the primary
surface for DDraw drawing, assuming that the image in it is what is
currently displayed on the screen.



-- 
Karl Lessard
Software engineering (Co-op) - Linux team
Corel Corp
karll@corel.com
.


=========================================================================

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic