Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26733 Discussions

Simulating video in a Quickwin project

New Contributor I

In my quickwin project, I have opened a viewport in which a polygon needs to move smoothly around to various positions according to a simulation process. Presently I am trying this by "predrawing" the hundreds of various possible positions and saving each frame to memory using GETIMAGE. Then for the real show I transfer selected images (according to the simulation) sequentially to the screen viewport using PUTIMAGE. It works but the performance is too slow. Is there an easy way I can instead utilize the API routines bltbk etc. to move the polygon around smoothly? The polygon fits nicely within a rectangular block. Think of a mouse pointer moving smoothly around, except it's a more complex shape and there may be several of them.

0 Kudos
4 Replies
Honored Contributor I

Are you trying to show some results as a movie? I have some 3D motion simulations using OpenGL that run in real time which isn't a problem but sometimes I want to save that as a movie and I found the simplest way was to save every frame as a bitmap (file0001.bmp, file0002.bmp, ....), automatically execute a freeware code (ffmpeg) to create an AVI at a specified framerate and then do a clean up (delete all the bmp files). You can then launch the movie with whatever tools you have on the PC.

BTW the problem you have is that QuickWin graphics are slow and there is no facility to double buffer. 

Black Belt Retired Employee

See for some ideas. If you want to use Jugoslav's Xeffort, see 

New Contributor I

I have managed to get reasonable--but not great--results by simply loading an image (bmp) file at the correct location at each time step, followed in the next time step by blanking it out and loading it again at the updated location. It works but is not very smooth and flickers more than I would like.

Andrew: I am not trying to "show some results as a movie" by creating an avi (or other) file to show after the fact; I need it to appear as a movie in real time as the simulation is being calculated.

I had hoped that this would be as simple as calling API routines to do things like CREATE the image at a desired location within my Quickwin graphics viewport, MOVE the image to a different location, and STRETCH the image to fit new boundaries. I had hoped this because a lot of API routines can be used in Quickwin, you just have to know the interface. Should I give up on this?

Another problem I am having is putting a SLEEPQQ or other delay function in the simulation calc step to display reasonably accurate real-time display of this "movie." The time steps I need are in the .05 to .5 sec range, and the delay functions I have tried are horribly inaccurate in this range. I'll start another thread on this subject if I can come up with a simple demo routine.

Black Belt

You may need to consider using the C interoperability features of Fortran to call C/C++ code to perform the frame updates. Look at this MSDN article for reference.

Or, you could consider using OpenGL (or in variant of GLUT)

Jim Dempsey