GPWiki.org
GPWiki.org
It is currently Thu Jun 20, 2013 10:23 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Apr 03, 2011 4:21 am 
Hello guys, anyone could help me, here in my codes..
My problem is that, when i Blit my surface in my backbuffer, then blit my backbuffer onto the primary.. nothing is shown.. only plain black..

Here is my code:

Code:
Public Sub InitWindow(WindowHWND As Long, Optional WindowHWND2 As Long)
Dim caps As DDSCAPS2
caps.lCaps = DDSCAPS_BACKBUFFER

MainWindowHWND = WindowHWND
MainWindowHWND2 = WindowHWND2

Set DD = DX.DirectDrawCreate("")
       
DD.SetCooperativeLevel WindowHWND, DDSCL_NORMAL
   
ddsd1.lFlags = DDSD_CAPS
ddsd1.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE
   
Set Primary = DD.CreateSurface(ddsd1)

ddsd2.lFlags = DDSD_CAPS Or DDSD_WIDTH Or DDSD_HEIGHT
ddsd2.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_3DDEVICE
ddsd2.lWidth = 320
ddsd2.lHeight = 240
   
Set picBuffer = DD.CreateSurface(ddsd2)

End Sub

Public Sub AttachSurface(Surface As DirectDrawSurface7, onWindowX As Long, onWindowY As Long, cropX1 As Long, cropY1 As Long, cropX2 As Long, cropY2 As Long)
Dim MainWindowRect As RECT
Dim cropRect As RECT
Dim cropRect2 As RECT

   ...
   
    picBuffer.Blt MainWindowRect, Surface, cropRect, DDBLT_WAIT
   
    Primary.Blt MainWindowRect, picBuffer, cropRect2, DDBLT_WAIT
   
   ...
   
End Sub




Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group