Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

Anyone read the article? I happened to stumble across it on a web search. Don't know when it was published. I have attached the file to this post. Sorry if old news.

12_14.pdf

Posted

It would be a lot cooler if I had any friggin idea what you're talking about! :D

But that's what makes GameEx great, really. It's so complicated, yet anyone can run it. Genius!

Posted

Yes indeed! Tom is the man who continually impresses!

Posted

I really enjoyed reading that, great article. One thing I would debate though is the use of BitBlt. When we were doing experimentations with screen rotation I found you can just write to the DirectDraw surface using a stream along with DirectShowLib. Check out the code below

IntPtr ip = IntPtr.Zero;
ip = video.GetBitmap();
if(ip != IntPtr.Zero)
{
Bitmap bmp = video.IPToBmp(ip);
System.IO.MemoryStream stream = new System.IO.MemoryStream();
bmp.Save(stream, ImageFormat.Bmp);
LockedData videoData = videoSurface.Lock(LockFlags.SurfaceMemoryPointer | LockFlags.WriteOnly);

videoData.Data.Write(stream.GetBuffer(), 54, (int) stream.Length);

videoSurface.Unlock();

Rectangle srcRect = new Rectangle(0, 0, 640, 480);
Rectangle destRect = new Rectangle(0, 0, 640, 480);
back.Draw(destRect, videoSurface, srcRect, DrawFlags.DoNotWait);

front.Flip(back, FlipFlags.DoNotWait);

bmp.Dispose();
bmp = null;
System.Runtime.InteropServices.Marshal.FreeCoTaskMem(ip);
ip = IntPtr.Zero;

stream.Close();
}

It would be interesting to know which method is faster, this one or a straight bitblt. Anyway, I sent you the code to this called VideoRotate to your FTP. Probably not worth looking into, but the above is probably the way I would approach the situation in VB.NET.

Posted

Hi Headkaze, for the rotation I do manipulate the memory. For straight memory copy I use bitblt, I think thats gotta be quicker than manipulating memory but dont know for sure. Only thing with manipulating the memory I found is the directdraw surfaces cannot be in video memory, otherwise its incredibly slow.

Also for the MNG videos this has to use DC's and API BlitBlt.

EDIT: By the way that articles been on the site for ages, in fact thats where it probably came from :)

Although, if you do spot other reviews or sites about GameEx please do let me know, including things like docs not in english.

On the GameEx site on the extras page, yourll see links to what I have already.

Please let me know if theres anything else out there I should be aware of.

Also if you want to add a comment for the comments page, please drop me a mail. Its always best though if I can have a name, and site if there is one, but not required.

Cheers.

Tom

Guest
This topic is now closed to further replies.
×
×
  • Create New...