Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: glDrawPixels problem in CAD application !

  1. #1
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    121

    glDrawPixels problem in CAD application !

    glDrawPixels is slow in OnBoard display card, does anyone know the fastest way that can give the same result. The speed is very important in a CAD program. i am not going to use wgl extension because not every display card support this function So can anyone tell me the best way to make my CAD program run smoothly even thought there are many object in the background when i am drawing? Does anyone know how autocad do it?(its good in every display card even in tnt2 & OnBoard display card. I wonder how autocad do it)
    Please help me!! because i need to submit my program to my boss soon. Thanks

  2. #2
    Intern Contributor
    Join Date
    Apr 2002
    Posts
    87

    Re: glDrawPixels problem in CAD application !

    The fastest alternative to glDrawPixels() on a hw-accelerated board is to use a textured quad. Combined with glTexSubImage2D(), this should give you much better performance compared to glDrawPixels(). Use glOrtho to correctly draw the quad in the window.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Melbourne,Victoria,Australia
    Posts
    767

    Re: glDrawPixels problem in CAD application !

    (a) You only need to ask once. People will answer your question if they see merit in doing so.

    (b) I would bet autocad doesn't use glDrawPixels. It probably uses a "rubber banding" technique like a bitwise operation such as NOT or the like. And it's probably single buffered. It's either that or a glCopyTexSubImage() call of some sort.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    121

    Re: glDrawPixels problem in CAD application !

    sorry for duplicate question, and thanks for ur reply, i will try the method you suggest

  5. #5
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    24

    Re: glDrawPixels problem in CAD application !

    > I would bet autocad doesn't use glDrawPixels

    I wouldn't bet on that, Blender still use glDrawPixels for background image drawing for example, and the reason I was given was that it was faster this way at the time the code was written for the target hardware.

  6. #6
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    121

    Re: glDrawPixels problem in CAD application !

    Originally posted by rgpc:
    (a) You only need to ask once. People will answer your question if they see merit in doing so.

    (b) I would bet autocad doesn't use glDrawPixels. It probably uses a "rubber banding" technique like a bitwise operation such as NOT or the like. And it's probably single buffered. It's either that or a glCopyTexSubImage() call of some sort.
    what is rubber banding technique and bitwise operation? how to use it? Do you have any example or website to find all this stuff. Thanks in advance.

  7. #7
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    121

    Re: glDrawPixels problem in CAD application !

    Originally posted by rgpc:
    (a) You only need to ask once. People will answer your question if they see merit in doing so.

    (b) I would bet autocad doesn't use glDrawPixels. It probably uses a "rubber banding" technique like a bitwise operation such as NOT or the like. And it's probably single buffered. It's either that or a glCopyTexSubImage() call of some sort.
    now i have know how to use rubber binding. but if there are many object say 20000 object. When i use rubber binding techniq, i will draw the object 2 times which is 20000*2 and if i have four view then it would be 20000*2*4 times.

    POSITION pos = m_objects.GetHeadPosition();
    while (pos != NULL)
    {
    CBomObj* pObj = m_objects.GetNext(pos);
    pObj->DrawShade(pView,1,shade);
    }
    everytime when i move the object to new position. I have to wait for the object list to complete the while loop first. So in 4 view case, I would have to wait for 4 while loop and it really take a long time.

    In autocad, when i move the object to new position, the object will regenerate from the beginning instead of drawing all the object in this case the mouse pointer will never delay when moving i wonder how autocad do it. Does anyone know the techniq?
    i would appreciate for any reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •