View Full Version : Learning 2D Graphics

22nd October 2007, 21:33
Hi guys,

I have an array of floats that I would like to display onto the screen using the graphics card GPU as opposed to the CPU (for performance reason). This array of float is basically a line of pixels on the display. I keep getting this line every x millisec, and needs to keep displaying it on the screen, while scrolling the previously-draw lines down, thus forming a 2D image.

I'm new to graphics, and would like to know where I can read up on how to do these sorts of things.

I have already tried looking at Qt 2D example, but didnt make much sense, and I'm quite new to graphics.


22nd October 2007, 21:40
Maybe you should start reading about OpenGL and QGLWidget if you want to use the GPU but if you have only some floats any widget can keep up with it, including the QGraphicsView.

22nd October 2007, 22:38
If you want to write to the GPU you will probably have to use Vertex Buffer Objects (VBOs). This will allow you to write to the video card memory. But like Marcel said read up on OpenGL. The QGLWidget will just provide you an alternative to using something like GLUT although it has some bonus features you don't get with GLUT (which are great). Some good books would be the Red Book, the OpenGL Reference Manual and the OpenGL SuperBible as well as NeHe (google NeHe for its website).

23rd October 2007, 01:01

Thanks both for the replies.

So basically, I have a class that is a wrapper for DirectDraw version 7 called CDDServices, and I want to upgrade this to use Qt/OpenGL (because I found that this class when stretched across 4 monitors, is just too slow).

Simply put, I want to keep the same class interface, but change the stuff under the hood (by using Qt graphics).

I guess the question is what Qt classes can do the stuff defined by this CDDServices class? (This question is for DirectDraw people then,)

23rd October 2007, 15:12
I would say if you are using DirectDraw instead of OpenGL you will probably need to look into using a QAxWidget. I used QAxWidgets for DirectShow stuff, so I would suggest looking into this.