Not sure if this should be in COM also. My current DD app does not use QueryInterface() to select a DD interface. What I do is:


I am also using some really old DD include, so it might not even support interfaces. I was told that I might be using DD ver1 by someone, I'd prefer using DD7.

First does anyone have a good DD include that supports interfaces?

Second, any quick example for QueryInterface()?
Posted on 2001-09-14 13:57:44 by ThoughtCriminal
Using DirectDraw means using Interfaces, The QuerryInterface stuff is (as you point it out) not required but its recomended as a nice behaveiour ;)

Besides the real COM stuff and Interfaces starts AFTER you create your DDraw Object and then derive Surfaces, Clippers, palletes and all other OBJECT stuff from it...

About using the latest interfaces....well you are if you use the latest DX....and drivers

New Interfaces only add functions (yeah sometimes structures/members also) to the end of the old ones. Nobody writes drivers for all OLD versions of DX instead they just call the new functions (hehe replace pointers as this is COM) so i guess you are using the latest tech anyway...even with DX1 or DX3...

Actually because of less params and stuff OLDER interfaces are faster then the new ones

The only problem is with NEW functions that only latest interfaces provide...if you need to use them you have to go for that Interface level...

I will search for an QuerrInterface example but the new trend is to use CoCreateInstance instead....

but i guess that the old QuerryInterface way is just as good for DX7, even DirectDrawCreateEx should work with no problem...
Posted on 2001-09-14 19:15:54 by BogdanOntanu
Most DX books (written for C++), look like they are using QueryInterface() to access the dll. I know LoadLibary() incremts a reference counter, just like QueryInterface(). One book said not to bother with AddRef, because just linking to the dll already increased the reference count by one. I'm curious if I'm missing out on something by just using LoadLibary() and GetProcAddress().

What does the DD7 interface give me that DD6 DD5 on down not give me. What C++ programers tald me is that the later interfaces made is easier to set up your enviroment. I've found it very easy to do with what I have now.
Posted on 2001-09-14 19:42:03 by ThoughtCriminal
You don't need the IUnknown interfaces.

I personally didn't include them at all in my includes, so my comcall has call eax+object+0ch (because there are Release, addref, and Queryinterface 4bytes a piece)
Posted on 2001-09-14 22:14:22 by Kenny

You bother too much for the rude stup steeps of your application

The nice things come after you setup a IDirectDrawX interface Any way of doing this initial setup is as good as other, the difference will be in your application/game in the way you will use them, thrying to make the "best setup in the world" means loosing valuable time IMHO

You will improve as you go and later you will understand initial things better, just go on man and start coding something you like ;)

The DX7 vs DX6 vs DX3 dilema is simple: each DX interface adda some things things to the old ones...ppl use to automatically believe tha NEW=GOOD/BETTER sometimes it IS sometimes is NOT, you will have to read Intefaces specifications and decide for yourself what you need and what you do not...

From my point of view DX7 and DX6 are pretty much the same
DX5 is stable, DX3 has less functions them DX5 and of course the fastest is the lower...but do not expect big speed improvements...

so i guess you can stick wit DX6 or DX7 if you want to be on the "safe side"

the so called more easy setup functions are just bloatware for C/C++ programmers that do not even know how to load a bitmap/texture or 3D Model int RAM without help from OS....
and other 10 bloated helper .DLLs

those days are the days of: "easy for me...and hard for the user"
ie user has to buy more and more hardware to support indecent bloated software made in 2-3 months of class copy and paste ;)

i also have no problems using IDirectDraw1 interfaces and the speed is very nice and i can load my own textures into ram without help from DX8 "integrated environment"
Posted on 2001-09-15 18:04:25 by BogdanOntanu
the so called more easy setup functions are just bloatware for C/C++ programmers that do not even know how to load a bitmap/texture or 3D Model int RAM without help from OS....
and other 10 bloated helper .DLLs

Figures thats the way it would be...

I might not be 100% sure which interface I'm using, but I do ahve all the funtionality I need.
Posted on 2001-09-17 13:36:08 by ThoughtCriminal