Results 1 to 5 of 5

Thread: Learning 2D Graphics

  1. #1
    Join Date
    Apr 2007
    Posts
    62
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Learning 2D Graphics

    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.

    Thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Learning 2D Graphics

    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.

  3. The following user says thank you to marcel for this useful post:

    ShaChris23 (22nd October 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Learning 2D Graphics

    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).

  5. The following user says thank you to ToddAtWSU for this useful post:

    ShaChris23 (23rd October 2007)

  6. #4
    Join Date
    Apr 2007
    Posts
    62
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Learning 2D Graphics

    Hi,

    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,)
    Attached Files Attached Files

  7. #5
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Learning 2D Graphics

    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.

Similar Threads

  1. Graphics View Event Propagation
    By pherthyl in forum Qt Programming
    Replies: 10
    Last Post: 3rd July 2008, 10:39
  2. QTreeWidget and Graphics scene
    By aamer4yu in forum Qt Programming
    Replies: 7
    Last Post: 21st December 2006, 17:24
  3. Adding Rectangular overlay on graphics view
    By forrestfsu in forum Qt Programming
    Replies: 10
    Last Post: 21st November 2006, 19:42
  4. QGLContext with multiple graphics cards
    By yuriy in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2006, 15:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.