flat assembler
Message board for the users of flat assembler.
Index
> Windows > DirectDraw windowed |
Author |
|
bogdanontanu 22 Mar 2006, 04:13
Remember that the Primary surface is the whole screen so you will have to offset the Blit with target window position. You can use GetClientRect API to obtain your window position on screen.
However you do not know in what resolution the screen it hold by the user and this will slow down and complicate things. In HE Map Editor (windowed) I recall dropping DirectDraw for the finnal Blit and using GDI... aparently it was more compatible and well suited for a windowed application. It also eliminated artifacts and color mapping / conversion problems. |
|||
22 Mar 2006, 04:13 |
|
madmatt 22 Mar 2006, 07:46
All right, I'll give that a try, thanks.
MadMatt |
|||
22 Mar 2006, 07:46 |
|
madmatt 22 Mar 2006, 08:44
Seems to be working real good, thanks!!!
|
|||
22 Mar 2006, 08:44 |
|
madmatt 22 Mar 2006, 15:50
Spoke too soon, If the formats are different then it Blits REAL sloooow. Even if there the same format, blitting goes slower than it ddraws blit. So I'll goe back to using ddraw blits and try and figure out how to get the primary surface and the window's client area to work together
|
|||
22 Mar 2006, 15:50 |
|
vid 22 Mar 2006, 16:49
yes, be sure to blit always 1:1, backbuffer must have same bits per pixel and area blitted from must be same size as area blitted to
|
|||
22 Mar 2006, 16:49 |
|
madmatt 23 Mar 2006, 01:07
Figured out the problem, I discovered that "GetClientRect" was giving me the wrong kind of coordinates that I needed for the blit (Flip) to work right. Instead I used the "GetWindowInfo" function that returned the correct "full screen" offset coordinates I needed. The code below shows what I mean.
FLIP WINDOWED Code: proc DDWFlipV .if dword [ddprimary], ne, NULL .if dword [ddback], ne, NULL mov [wininfo.cbSize], sizeof.WINDOWINFO invoke GetWindowInfo, [winhandle], wininfo ;Use this instead of GetClientRect DDCALL ddprimary, Blt, wininfo.rcClient, [ddback], NULL, DDBLT_WAIT, NULL .endif return DD_OK .else return -2 .endif endp |
|||
23 Mar 2006, 01:07 |
|
Madis731 23 Mar 2006, 07:51
What are you workin' on? A game??? I LOVE GAMES
|
|||
23 Mar 2006, 07:51 |
|
madmatt 24 Mar 2006, 08:04
Hi, Vid
No, Just a dll library of directdraw/direct3d/utility functions, which is comming along rather nicely now. Just need to update the documentation and make some kind of tutorial for it. Of course, though, you CAN make games/demos with it. It's primary purpose. It also allows you to use direct3d for your blitting as well. Which means rotations and special effects. I'll post some examples in a while. Can't say exactly when though. |
|||
24 Mar 2006, 08:04 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.