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 3 of 3

Thread: Flashing then Texture Size

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2010
    Posts
    2

    Flashing then Texture Size

    Dear All,

    If anyone can help?

    My opengl program works fine in windows XP. But in Vista and 7 during refreshing of scene it flashes. I checked and saw many forums around this flashing and flickeing issue but no answer.
    I changed the program from draw_to_window to draw_to_bitmap and flashing is solved. Congratulations...
    Everything seems to be okay. But no.

    Now there is a new issue and that is about maximum texture size.
    When working in draw_to_window, the maximum texture size given by glgetintegerv returns 4096 on my system, and when draw_to_bitmap, it is 1024.

    Before going further, if you want please check these two topics both in MSDN:
    OpenGL VI: Rendering on DIBs with PFD_DRAW_TO_BITMAP and
    OpenGL VII: Scratching the Surface of Texture Mapping

    in the second topic, the author has written:

    "glGetIntegerv(GL_MAX_TEXTURE_SIZE, &glMaxTexDim);
    glMaxTexDim = min(128, glMaxTexDim);

    The first line gets the maximum allowable size for an image to be used as an OpenGL texture map. On my system, this value happens to be 1024. This size may vary, depending on your system, especially if you have an OpenGL-accelerated video card."

    I guess he didn't realize that in draw_to_bitmap, it is always 1024.

    I checked my codes many times, and I reached to this point:

    setup some codes with draw_to_window flag and just after wglmakecurrent, check this glGetIntegerv(GL_MAX_TEXTURE_SIZE, &glMaxTexDim), and it returns 4096, 2048 etc. depends on the system, and
    then again with draw_to_bitmap, and again just after wglmakecurrent, it returns 1024.

    Now the question is: WHY?

    Thanks in advance to all,

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Flashing then Texture Size

    draw_to_bitmap is not accelerated. You end up using the old crappy Gl version from Microsoft which does not take advantage of your graphic card.
    So this is a bad workaround.

    Can you describe more precisely the original problem 'scene flashes' ?
    Do you use double-buffering ? Mix GDi and openGL ? Is Aero compositing activated or not ?

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2010
    Posts
    2

    Re: Flashing then Texture Size

    Dear Sir,

    Thanks for your answer. Sorry for the delay.

    So it seems I should forget about draw_to_bitmap.

    As for the flashing, I used "pfd_draw_to_window or pfd_support_opengl or pdf_double_buffer" exactly when working in drawing to window, and then I used swapbuffers.

    I need to check it again to be able to describe it in more detail later.

    By the way what is Aero compositing?

    Thanks in advance.

Posting Permissions

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