|
-
Mar 29th, 2002, 01:35 PM
#1
Thread Starter
Lively Member
There has GOT to be something I'm missing, here.
Okay. DirectX 7, Windowed 2D mode (direct draw).
I've got a back buffer, primary surface, and a couple of standard surfaces with bitmaps on them.
BlitFast am bitmap to the back buffer, Blt to the primary surface, something's supposed to happen, right? I get zilch. No errors, no crashes, just a black window. I know the bitmap holding surfaces work, because I can do a BltToDC right to the window and they show up.
What am I missing?
I do know that the bitmaps I'm drawing are wider than the backbuffer at all times. This shouldn't cause a problem, should it? I don't know of any way to attach a clipper to a backbuffer... This is driving me nuts.
~Zero the Inestimable
-
Mar 29th, 2002, 01:41 PM
#2
Good Ol' Platypus
Windowed Mode does not allow using the GetAttachedSurface method on the Primary surface to get a Backbuffer. You must make one yourself (like you do in the GDI, make another surface, blit to that, blit to the screen, etc.)
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 29th, 2002, 02:53 PM
#3
Thread Starter
Lively Member
...
Yes, I'm aware of that. My "Backbuffer" is just a regular surface to which I blit things manually, and manually send to the primary surface.
Let me modify this query a bit: I discovered, though testing, that I can indeed blit with this method and make it work. When I swapped out my bitmaps for smaller ones everything draws. The kicker is, the bitmaps I need to use will at (almost) all times be larger than the window. If I blit one of these to the backbuffer and it falls off the edge DX just ignores it, and I get nothing. How do I blit things to a surface that are larger than the surface itself?
~Zero the Inestimable
-
Mar 29th, 2002, 06:20 PM
#4
Good Ol' Platypus
Oh! What you'll need to use is the method Blt with the destination RECT's bounds set inside the width and height, and higher than 0. Then you'll need to modify where you copy it from on the source bitmap. Quite easy to do if you think about it.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 29th, 2002, 08:41 PM
#5
Thread Starter
Lively Member
...
Repeat after me: "Owa, tagu, siam..."
I suppose that should've been the first thing I thought of. There's a reason for those silly Rects after all, eh? As I recall you can define a source Rect with BlitFast, no? I hope I don't drop much speed doing the extra calculation with this.
Results coming soon, probably tomorrow. Thanks for the kick in the pants...
In case you're wondering, I'm doing a from-scratch UI, since with DirectX you can't really use VB components effectively. My menubars are 1600 pixels wide (to accomodate people at insane resolustions - the window will politely refuse to be resized larger than 1600 pixels wide by 1280 pixels tall), so a nice chunk of that falls off the edge of the window with each repaint. I was under the impression that "clippers" were supposed to handle this sort of thing, but apparently they only do so with the primary surface itself in Windowed mode. I'm out of luck there. I haven't really seen a good explanation of how clippers work or are supposed to be used... Does anyone have a link offhand?
~Zero the Inestimable
-
Mar 30th, 2002, 12:24 PM
#6
Addicted Member
You cannot use BltFast with windowed mode.
Why?
Because you HAVE to use a clipper when you have a window'ed primary buffer.
also be aware that the primary surface still covers the entire screen. Everything that isn't wanted is clipped. when blting from the backbuffer (which i assume is the same size as the window you connected your primary surface too) you need to offset the blt.
Take alook at http://www.wlv.ac.uk/~c9818573/TileTest.zip
The use of back and primary buffers in window mode works perfectly.
Some Days, i just get this feeling that i'm helping to write dozens of Viruses...
-
Mar 30th, 2002, 06:29 PM
#7
Thread Starter
Lively Member
...
That's funny... It lets me Blitfast just fine now.
~Zero the Inestimable
-
Mar 30th, 2002, 10:00 PM
#8
Addicted Member
Sorry you can use bltfast to blt to backbuffer, but not to blt the backbuffer to the primary buffer. because bltFast will not work with a clipper object (well never tried it to be honest but thats what the help files say).
You need to use a clipper object with the primary surface otherwise it starts screwing up when other windows are on top of it.
Some Days, i just get this feeling that i'm helping to write dozens of Viruses...
-
Mar 31st, 2002, 06:57 PM
#9
Thread Starter
Lively Member
...
Ah. Yes, that's about what I did.
Now for the real hard part: Resizing a borderless window! Huzzah. Back to the front lines for me...
Thanks for the help.
~Zero the Inestimable
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
|