PDA

View Full Version : quickly drawing images - movie like



hants
09-29-2008, 07:44 AM
hi,

im quite(absolutely) new to opengl programming and am searching for a fast way to draw computed pixel values.

the situation is as follows: i hava an array in system memory(eg. at least 256*256*4 - in my case 4 grey level cooccurrence matrices or some other statistics extracted from some movie data), it changes every frame - and i want to bring it as fast to the monitor as possible (realtime).

The pixelbufferobjects extension doesnt seem to exist according to ozone3ds caps viewer) on my graphics card - its an ati hd2400xt.

im using a qt qglwidget to get a opengl context - and use glDrawPixels. howewer its pretty (incredibly) slow even on 512*512.

glTexImage seems to be even slower.

Does anyone know a way to draw (large eg 1024*1024*4) pixel arrays in a fast way (maybe a webpage with an simple explanation)? or even better knows a place where i can get some (hopefully simple) example source?

Im searching for 2 weeks already and my code became such crap - i dont even dare to post it here.

my development environment currently is windows xp and visualstudio 2005 - but it also has to work with linux.

Thanks in Advance,
hants

trinitrotoluene
09-29-2008, 08:08 AM
glTexImage seems to be even slower Do you try with glTexSubImage? NeHe have a tutorial (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=35) to build an avi player which use glTexSubImage.

Edit:

The pixelbufferobjects extension doesnt seem to exist according to ozone3ds caps viewer) on my graphics card - its an ati hd2400xt. Do you fetch the latest drivers from ati? My video card is a TnT2 (1999) and I have GL_EXT_pixel_buffer_object extension supported!

Zengar
09-29-2008, 11:26 AM
Use SDL instead of OpenGL

hants
09-30-2008, 12:28 AM
thanks!

the nehe site solves my problem pretty well :D

hants
09-30-2008, 06:09 AM
Well trinitrotoluene - you were right.

My Card has the Pixel Buffer Objects extension available - using windows opengl headers probably wasnt such a good idea ;)

doing it the way its described in the tutorial resulted in bad performance when drawing 1024*1024 pixels.

i solved it that way: http://videogameprogramming.blogspot.com/2007/03/2-d-textures-creating-deleting-locking.html

quite simple in the end - just a few lines more.
now there are no performance problems anymore no matter how often i want to draw pixel arrays in any resolution i want :)

Thanks again!