I made some modifications for the file Fddraw.
The speed of execution of Direct Draw is sharply increased.
I have create a supplementary surface lpDDS1 situated only in memory video.
This surface is filled with a thorough decoration before the appeal in the main loop
She is of use then of surface of refreshment to the surface of drawing lpDDSBack.
It is faster than to go for a complete screen in the surface lpDDSPicture which has to be in big part in the memory system.
For the same program written with Masm, Fasm work more fast and so one can put more drawings before the slowing down!
Friendly......Gges
The speed of execution of Direct Draw is sharply increased.
I have create a supplementary surface lpDDS1 situated only in memory video.
This surface is filled with a thorough decoration before the appeal in the main loop
She is of use then of surface of refreshment to the surface of drawing lpDDSBack.
It is faster than to go for a complete screen in the surface lpDDSPicture which has to be in big part in the memory system.
For the same program written with Masm, Fasm work more fast and so one can put more drawings before the slowing down!
lpDDS1 dd 0
...........
..........
; ------------------------------------------------------
; Creation of a surface lpDDS1 in memory video
; ------------------------------------------------------
mov [ddsd.dwSize],ddsd.end-ddsd
mov [ddsd.dwFlags],DDSD_CAPS+DDSD_WIDTH+DDSD_HEIGHT+DDSD_CKSRCBLT
mov [ddsd.ddsCaps.dwCaps],DDSCAPS_OFFSCREENPLAIN
mov [ddsd.dwWidth],L_ECRAN
mov [ddsd.dwHeight],H_ECRAN
comcall [lpDD],IDirectDraw.CreateSurface,ddsd,lpDDS1,0
or eax,eax
jnz ddraw_error
call remplirfond ;Here drawing of lpDDSPicture = > lpDDS1
jmp paint
main_loop:
....code
...........
no_message:
....code
...........
paint:
......code
; -------------------------------------
; Here lpDDS1 = > lpDDSBack
; -------------------------------------
mov [rect.top],0
mov [rect.bottom],H_ECRAN
mov [rect.left],0
mov [rect.right],L_ECRAN
comcall [lpDDSBack],IDirectDrawSurface.BltFast,0,0,\
[lpDDS1],rect,DDBLTFAST_NOCOLORKEY
....code
Friendly......Gges
Hi !:)
Tomasz, working on a program with Fasm and Fddraw, I have some difficulties with GetDC.
Several times stake in the screen of the chain makes correctly the other times not.
Popular principle:
To put in the screen a text under Fddraw by stopping the progress of the program during some seconds to leave time with the user to read a message.
Note:
Before I did not use GetDC but a text stored in lpDDSPicture which I called with BltFast and there everything worked well .
Shape db would save me of the place for the current texts.
Here is incriminated code:
Friendly.......Gges
Tomasz, working on a program with Fasm and Fddraw, I have some difficulties with GetDC.
Several times stake in the screen of the chain makes correctly the other times not.
Popular principle:
To put in the screen a text under Fddraw by stopping the progress of the program during some seconds to leave time with the user to read a message.
Note:
Before I did not use GetDC but a text stored in lpDDSPicture which I called with BltFast and there everything worked well .
Shape db would save me of the place for the current texts.
Here is incriminated code:
titre1 db 'Welcome under Fasm',0
;...................
stdcall [GetDC],[newhwnd]
mov ebx,eax
stdcall [GetSysColor],COLOR_HIGHLIGHT
stdcall [SetBkColor],ebx,eax
stdcall [GetSysColor],COLOR_HIGHLIGHTTEXT
stdcall [SetTextColor],ebx,eax
mov [rect.left],200
mov [rect.right],560
mov [rect.top],580
mov [rect.bottom],598
stdcall [DrawText],ebx,titre1,18,rect,\
DT_SINGLELINE or DT_RIGHT or DT_BOTTOM
stdcall [ReleaseDC],ebx
;
comcall [lpDDSPrimary],IDirectDrawSurface.Flip,0,0
;
stdcall [PlaySound],szSound,NULL,SND_LOOP+SND_ASYNC+SND_FILENAME
pause 30 ; macro of wait
Friendly.......Gges
Hi Asmgges, sorry I can't help you with your problem. I don't know enough about DD
But could you post your improved code for ffdraw, I like to have it, but can't seem to get it compile by copying and pasting the bits from here. :(
Thanks.
But could you post your improved code for ffdraw, I like to have it, but can't seem to get it compile by copying and pasting the bits from here. :(
Thanks.
Hi ! Eoin:)
Thank you for your answer.
File in the size .txt joined
Friendly....Gges
Thank you for your answer.
File in the size .txt joined
Friendly....Gges