News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Using DirectDraw

Started by NoCforMe, March 02, 2025, 09:41:53 AM

Previous topic - Next topic

TimoVJL

Quote from: jj2007 on March 05, 2025, 07:33:53 AMSo... how complicated would it be to draw a circle in Direct3D?
at this point i borrow a thing like Agatha Christie, why you don't ask from Siekmanski
May the source be with you

adeyblue

Quotealso Direct2D is deprecated and included to Direct3D since version 9
Classic Microsoft, deprecating something years before they've even invented it

NoCforMe

I wouldn't be against folks posting examples of those other APIs (Direct2D and Direct3D) here, since they're somewhat related to DirectDraw.

It's all good. (Even if it's "deprecated"!)
Assembly language programming should be fun. That's why I do it.

Siekmanski

Use the provided files msvcrt.lib and msvcrt.inc and it should work.

All libs and include files are in the zip file
Creative coders use backward thinking techniques as a strategy.

Siekmanski

Here some examples to use Direct3D9 in 2D mode.
Creative coders use backward thinking techniques as a strategy.

_japheth

Another dd example, that needs no external include or lib files and uses GDI to draw to primary surface.
Dummheit, gepaart mit Dreistigkeit - eine furchtbare Macht.

jj2007

Quote from: Siekmanski on March 05, 2025, 12:03:02 PMHere some examples to use Direct3D9 in 2D mode.

To build S_lib_Sprite.asm, replace all sprintf with crt_sprintf. However, it hangs in D3DDrawText  :cool:                       


00401275  |.  68 544D4000  push offset szString_buffer              ; /Arg6 = ASCII "FPS: 0.049  Timer: 20.567"
0040127A  |.  68 00FFFFFF  push -100                                ; |Arg5 = -100
0040127F  |.  FF35 B8414000 push dword ptr [??0023]                  ; |Arg4 = 41600000
00401285  |.  FF35 B4414000 push dword ptr [??0022]                  ; |Arg3 = 0
0040128B  |.  FF35 B0414000 push dword ptr [??0021]                  ; |Arg2 = 0
00401291  |.  FF35 04404000 push dword ptr [g_pD3DDevice]            ; |Arg1 = 7E8BE0
00401297  |.  E8 5C0D0000  call D3DDrawText                        ; \S_lib_Sprite.D3DDrawText
More precisely, here:
CPU Disasm
Address   Hex dump          Command                                  Comments
0040216C  |.  8B55 08       mov edx, [arg1]
0040216F  |.  8B12          mov edx, [edx]
00402171  |.  FF75 F4       push dword ptr [local.3]
00402174  |.  6A 00         push 0
00402176  |.  FF75 F8       push dword ptr [local.2]
00402179  |.  6A 00         push 0
0040217B  |.  6A 00         push 0
0040217D  |.  6A 04         push 4
0040217F  |.  FF75 08       push dword ptr [arg1]
00402182  |.  FF92 48010000 call near [edx+148]                      ; hangs here

Quote from: _japheth on March 05, 2025, 04:11:40 PMAnother dd example, that needs no external include or lib files and uses GDI to draw to primary surface.

Builds & runs fine. You may have to add \masm32\bin\jwasm in the make.bat

daydreamer

to run old ddraw code,probably some old ddraw game installed before with ddraw makes it works
I have made many ddraw code SSE,even MMX
compared to pixelshaders,SSE have limited to fast sqrt =pixelshader way of drawing circles
 
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding