flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > Difference between directdraw 1 and directdraw 7 ?

Author
Thread Post new topic Reply to topic
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 31 Mar 2018, 09:30
Curious what exactly changed since the first version. Going full archaeologist. Only dos is older.

Found one code that uses directdraw 1 here https://www.mycplus.com/tutorials/microsoft-direct-x-programming/directdraw-sample/ , need to search for directdraw 7 examples now.

By the way, it really surprised me that directdraw actually allows sprite rotation. Though, hardware not always allow that, and directdraw wouldn't do it in software for you automatically (it will do scalling up and down and filtering for you, but not rotation, too expensive to do in software).
Post 31 Mar 2018, 09:30
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 31 Mar 2018, 13:00
vivik wrote:
Curious what exactly changed since the first version. Going full archaeologist. Only dos is older.

Found one code that uses directdraw 1 here https://www.mycplus.com/tutorials/microsoft-direct-x-programming/directdraw-sample/ , need to search for directdraw 7 examples now.

By the way, it really surprised me that directdraw actually allows sprite rotation. Though, hardware not always allow that, and directdraw wouldn't do it in software for you automatically (it will do scalling up and down and filtering for you, but not rotation, too expensive to do in software).

I guess, the easiest way would be to look for DirectX SDKs containing these versions. Although I never managed to find anything earlier than DirectX 5 SDK. If you need anything from SDKs 5-6-7, let me know (I guess, SDK documentation would be more useful for your task than plain samples).
Post 31 Mar 2018, 13:00
View user's profile Send private message Visit poster's website Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 31 Mar 2018, 14:35
sdk 7 and 5 will be useful. Maybe only docs and a few examples from there.
Post 31 Mar 2018, 14:35
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 31 Mar 2018, 15:05
I think I found docs for older directdraw. Need to compare them, to see what changed.


idirectdraw GetAvailableVidMem

https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ee490253(v=winembedded.80)




IDirectDraw4::GetAvailableVidMem

https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms893924(v=msdn.10)



https://msdn.microsoft.com/en-us/library/windows/desktop/gg426142(v=vs.85).aspx

IDirectDraw7::GetAvailableVidMem
Post 31 Mar 2018, 15:05
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 31 Mar 2018, 15:55
Well, found the first difference.

IDirectDrawSurface::Lock has DDLOCK_DISCARD, but IDirectDrawSurface7::Lock doesn't. As a consequence, my version of ddraw.h that came with SDK9 doesn't have that...

That doesn't tell much though. It only means that I have to search for an older sdk...

Really curious if first directdraw will work just as well as the seventh. Though, I probably shouldn't bother...
Post 31 Mar 2018, 15:55
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 31 Mar 2018, 17:07
I think there is an error in the fasm ddraw example. It uses directdraw1 (since there is no "pDDraw->QueryInterface( IID_IDirectDraw7, ( VOID** )&pDDraw7 )" anywhere), yet it uses directdraw7 flags for ->Lock().

Compare.

c:/shared/my_programs/fasmw172/EXAMPLES/DDRAW/DDRAW.INC

; DirectDrawSurface lock flags

DDLOCK_SURFACEMEMORYPTR = 000000000h
DDLOCK_WAIT = 000000001h
DDLOCK_EVENT = 000000002h
DDLOCK_READONLY = 000000010h
DDLOCK_WRITEONLY = 000000020h
DDLOCK_NOSYSLOCK = 000000800h


C:\Program Files\Microsoft DirectX SDK (November 2008)\Include
ddraw.h

(this is SDK9)

#define DDLOCK_WAIT 0x00000001L
#define DDLOCK_EVENT 0x00000002L
#define DDLOCK_READONLY 0x00000010L
#define DDLOCK_WRITEONLY 0x00000020L


http://ftp.icpdas.com.tw/pub/beta_version/VHM/wince600/at91sam9g45m10ek_armv4i/cesysgen/sdk/inc/ddraw.h

#define DDLOCK_READONLY 0x00000001
#define DDLOCK_WRITEONLY 0x00000002
#define DDLOCK_DISCARD 0x00000004
#define DDLOCK_WAITNOTBUSY 0x00000008



After many years of staring in confusion, lol.
Post 31 Mar 2018, 17:07
View user's profile Send private message Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 31 Mar 2018, 17:09
Though, maybe those are wince flags. Yes they are, ignore message above.


Last edited by vivik on 31 Mar 2018, 18:04; edited 1 time in total
Post 31 Mar 2018, 17:09
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 31 Mar 2018, 17:27
vivik wrote:
sdk 7 and 5 will be useful. Maybe only docs and a few examples from there.

Cut out docs and DirectDraw samples. Note that DX SDK 7 contains docs for 6.1 for some reason. Included them as well.

I had to upload them to Google Drive due to the 5 MB quota of the forum.
Post 31 Mar 2018, 17:27
View user's profile Send private message Visit poster's website Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 31 Mar 2018, 17:27
Huh, you can create IDirectDraw7 either with

DirectDrawCreateEx

or with

DirectDrawCreate
QueryInterface

https://www.gamedev.net/forums/topic/28908-directdrawcreate-error/

@DimonSoft
Thank you~
Post 31 Mar 2018, 17:27
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 31 Mar 2018, 18:38
I have not re-visited this old DirectDraw example in ages, it was written a bit sloppily and perhaps deserved some careful examination and polishing. Nowadays I should perhaps scrap it entirely and replace with a Direct2D example?
Post 31 Mar 2018, 18:38
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 31 Mar 2018, 22:50
Tomasz Grysztar wrote:
I have not re-visited this old DirectDraw example in ages, it was written a bit sloppily and perhaps deserved some careful examination and polishing. Nowadays I should perhaps scrap it entirely and replace with a Direct2D example?

IMHO, some simple rotating cube with Direct3D would be more impressive for newbies.
Post 31 Mar 2018, 22:50
View user's profile Send private message Visit poster's website Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 671
vivik 01 Apr 2018, 05:20
Don't scrap it, add direct2d nearby if you wish.

Ideally you'd rewrite an entire sdk in assembly, but I can't ask for that, can I? Not many people use assembly for gamedev nowadays.

Game examples would be useful... Most of games I know are closed source.
Post 01 Apr 2018, 05:20
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 01 Apr 2018, 13:21
vivik wrote:
Game examples would be useful... Most of games I know are closed source.
Yeah, unfortunately the only ones I published here are my very old game engines for DOS (like "kelvar" and even older "Glumpy"). Recently I considered sharing the source code of a very simple SDL-based game framework that I've been putting together with some friends just for fun a couple years ago, but I would need to get their permission first.
Post 01 Apr 2018, 13:21
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.