|
-
Dec 25th, 2004, 02:41 PM
#1
Thread Starter
Banned
VB: DX CLIPPER over window
Last edited by _visual_basic_; Dec 25th, 2004 at 03:35 PM.
-
Dec 25th, 2004, 03:22 PM
#2
Re: VB: DX CLIPPER over window
The problem is that you aren't using a main game loop, which consist on clearing the window, drawing to the backbuffer surface, then blitting the backbuffer to the primary surface. This loop will do this over and over again until the program has been closed, and must be active the whole time the program is up. All you have right now are events that only clear it and blit it once until another action has taken place.
Another problem is this right here in your InitDX sub:
VB Code:
Set DDC = DD.CreateClipper(0)
You need more than that to set up the clipper. What I did with my DX7 projects to set up the clipper in my DirectX Initialization subs is this:
VB Code:
'Creating clipping regions
'------------------------------------------------------------
Set dd_clip = dd.CreateClipper(0)
dd_clip.SetHWnd hWnd
primary.SetClipper dd_clip '<---- Why don't you have this?
That's what you were missing. PrimarySurface.SetClipper DDC. One more thing I would like to add. You don't need Let statements (unless of course you are making properties in a class module). Using Let a = b was the old method back in the 80's. It's still supported and all, but not needed. You have a lot of them in your InitDX sub.
-
Dec 25th, 2004, 03:32 PM
#3
Thread Starter
Banned
Re: VB: DX CLIPPER over window
oh you in teh DrawMap routine there is a piece of code that does this:
VB Code:
If hWnd > 0 Then
Call DDC.SetHWnd(hWnd)
Else
Let hWnd = DDC.GetHWnd
If hWnd < 1 Then
Exit Sub
End If
End If
-
Dec 25th, 2004, 03:33 PM
#4
Thread Starter
Banned
Re: VB: DX CLIPPER over window
OH wait i forgot to attack the clipper to the sirface i think...
-
Dec 25th, 2004, 03:35 PM
#5
Thread Starter
Banned
Re: VB: DX CLIPPER over window
attach*
surface*
i got it working now. THANKS ALOT
sometimes when i code to much in one time i forget all kinds of things...
-
Dec 25th, 2004, 03:50 PM
#6
Re: VB: DX CLIPPER over window
I'm just slick like that 
And now you know why it's sometimes always helpful to upload your projects.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|