http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display Graphics



Hallo,

I've done this kinda thing with D3D loads of times and it's very suited to
the task. If you take your image (like a 640x480 one) and create several
256x256 texture pages (or one big one, but I don't like recreating video
texture pages) you can construct a simple poly mesh that you can map your
image onto. The good thing about this is that if you want your app to run
windowed, you can scale it by just altering the poly sizes (or if you want
to work in varying resolutions).

For every frame, simply upload a new version of the image onto your created
texture pages. The "guaranteed always to work on all cards" version of this
is to first of all to create a temporary system texture page surface
(DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE), lock the surface and copy your
data to it manually (remember to unlock afterwards :0). When that's done,
use the IDirectDrawSurface4::Blt() function to copy from the system texture
page to the destination video texture page and it will be uploaded for the
new frame. Now just redraw the polys.

I've tried locking the video texture page before and manually writing to
that but it doesn't always work. My Voodoo2 handled it fine but my Rage ATI
Pro just didn't upload anything (and that's the fastest card, maybe because
it's an AGP primary). Other people I gave my programs to test also reported
that the textures weren't being uploaded.

This whole method might sound very slow but it's surprisingly very quick,
even on the worst of cards. I managed to get a 24-bit AVI compressed with
Indeo 5 at 512x256, running at 24fps (I have my frame rates synched to that
normally so it might be going a little bit faster). And because I was using
16-bit texture pages I had to manually convert each frame from 24-bit ->
16-bit on the fly. It's a pretty nice system which work surprisingly well.

That's the route I'd take anyway, if you need any of the source code, just
gimme a mail.

Seeya,
- Don
-----Original Message-----
From: Hall, Russell E <Russell.Hall@bridge.bellsouth.com>
To: gameprogrammer@gameprogrammer.com <gameprogrammer@gameprogrammer.com>
Date: 10 September 1999 08:21
Subject: Display Graphics


>
>Hello,
>
>
>I'm having a bit of trouble.  I have created an animation sequence in
Truespace
>3 and had it create the output as a set of numbered .tga files.  I would
like
>to display each one of these files in order, one on top of the other with a
>slight pause in between each frame to simulate a movie or a cutscene for my
>game.
>
>I've thought of using openGL and wrapping the texture onto a 2d surface
like a
>square but I'm have trouble with the process.  In openGl you must write a
>function to read in the image and then another function to do the wrapping
and
>that whole process I just can't seem to get down pat.
>
>Could someone suggest either a better way of getting a cutscene into a game
or
>a link to opengl(other than opengl.com) or directX that could help me out.
>
>
>Thanks for your help and advice,
>
>Russell
>-- The New B --
>
>
>
>
>=================================================================
>To SUBSCRIBE or UNSUBSCRIBE please visit
>http://gameprogrammer.com/mailinglist.html
>
>


=================================================================
To SUBSCRIBE or UNSUBSCRIBE please visit
http://gameprogrammer.com/mailinglist.html