Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 07-19-2002, 03:37 PM   #1
Member (5 bit)
 
Join Date: May 2002
Location: Mtl,CAN
Posts: 16
Pissed Help with backbuffer

Im stuck...
Developping your first game in VB is hell

I use 2 picture boxes, one for the backbuffer where I draw
everything and one for the game screen where I do the final
blit.
The problem is that when I hide the backbuffer (either visible=false or putting it somewhere very far...), it hides the screen too! This doesn't happen if I set autoredraw to true, but Im doing a backbuffer to avoid this since its slow as hell. What can I do to hide the backbuffer and be able to see the screen?
AlexDX is offline   Reply With Quote
Old 07-19-2002, 03:47 PM   #2
RJ
Member (14 bit)
 
Join Date: Feb 2000
Location: Offenbach/Main (Germany)
Posts: 8,485
Send a message via ICQ to RJ
Hi,

so you have a real backbuffer (I mean, not just an offscreen surface, but a complex surface) ?
If so, then the backbuffer is always hidden, and the primary surface is visible.
You display the backbuffer by flipping it (method is "flip"). The pointers of primary surface and backbuffer will be exchanged, thus the backbuffer will become the primary surface (primary will become offscreen) and be displayed on the screen.

RJ
__________________
All's right with the world when your PC is working right.
RJ is offline   Reply With Quote
Old 07-19-2002, 04:01 PM   #3
Member (5 bit)
 
Join Date: May 2002
Location: Mtl,CAN
Posts: 16
This sounds interesting but Im not understanding
anything How can I implement this RJ???
AlexDX is offline   Reply With Quote
Old 07-19-2002, 04:16 PM   #4
RJ
Member (14 bit)
 
Join Date: Feb 2000
Location: Offenbach/Main (Germany)
Posts: 8,485
Send a message via ICQ to RJ
Can't exactly tell you coz I've never used VB.
The APIs are the same, though, only the syntax is different.

What do you mean with "implement" ?
Do you mean how to create the complex surface ?
Well, some tutorials from where I've learned DirectDraw programming showed the examples in VB.
This one explained it for DirectX 7:

Dim ddScreen As DirectDrawSurface7
Dim ddsdScreen As DDSURFACEDESC2

ddsdScreen.lFlags = DDSD_CAPS Or _
DDSD_BACKBUFFERCOUNT

ddsdScreen.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or _
DDSCAPS_COMPLEX Or _
DDSCAPS_FLIP

ddsdScreen.lBackbufferCount = 1

Set ddScreen = DirectDraw.CreateSurface(ddsdScreen)

And then the backbuffer:

Dim ddBackbuffer As DirectDrawSurface7
Dim ddsdBackbuffer As DDSURFACEDESC2
Dim caps As DDSCAPS2

caps.lCaps = DDSCAPS_BACKBUFFER
Set ddBackbuffer = ddScreen.GetAttachedSurface(caps)
ddBackbuffer.GetSurfaceDesc ddsdBackbuffer

Should be similar to how you did it, right ? I guess the only differences are the DDSCAPS_COMPLEX, DDSCAPS_FLIP flags to create the complex surface.

BTW, you're using DirectX, right ? I forgot to ask this, coz Backbuffer suddenly reminded me of my past days as a programmer and the last I did was programming for DirectX (in DirectDraw there is a primary surface and a backbuffer). If you're not programming a DirectX game then sorry I got you wrong

RJ
RJ is offline   Reply With Quote
Old 07-19-2002, 04:30 PM   #5
Member (5 bit)
 
Join Date: May 2002
Location: Mtl,CAN
Posts: 16
hehe NP, thanks for the advice RJ, but its too advanced for me,
I haven't looked at DirectX yet, I only know some basic APIs for using in VB!
AlexDX is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:20 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2