OpenGL Refresh problem using CsGL with VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Thompson

    #1

    OpenGL Refresh problem using CsGL with VB.NET

    Hi,

    I have an application I have written in VB.NET. Part of the application
    is to display 3D models of buildings and allow the user to zoom and
    rotate around them. I have implemented this using the CsGL wrapper
    library with OpenGL. When it works, it works very well. I have a
    problem though.

    On some systems, the 3D view (which is available on a sub-dialog from
    the main form shown modally) does not always refresh. By that I mean
    that sometimes you can end up with a situation where just whatever is
    behind the 3D View control is shown solidly, e.g. word document,
    desktop etc. It remains, sometimes for several seconds, sometimes
    permanently. I have found that sometimes if you resize the form, or
    move something in front of it and then go back to it, that forces the
    refresh and then we are OK again. However, sometimes even that will not
    work and the only way to resolve is to close down the application and
    start it again.

    Like I say though, this is only on some systems. On most of the systems
    we have tried it on it is absolutely fine. I am concerned though that
    some of our users might have problems of this nature, which although
    not devastating, are very annoying.

    I am double buffering the form and and firing a timer 25 times a second
    on the form which calls the necessary refresh on the control. I adapted
    the mechanism I am using from one of the NeHe tutorials.

    Any ideas would be welcome as to what I might be able to try to improve
    the situation. Even advice like, "do not use CsGL, use something else"
    would be useful as I know development was ceased in 2003 for this
    library.

    Also, is it possible that just some graphics cards will always be a bit
    dodgy with 3D rendering and there is not much I can do about it?

    Thanks in advance,

    Mark.

  • fungus

    #2
    Re: OpenGL Refresh problem using CsGL with VB.NET

    Mark Thompson wrote:
    >
    I am double buffering the form and and firing a timer 25 times a second
    on the form which calls the necessary refresh on the control. I adapted
    the mechanism I am using from one of the NeHe tutorials.
    >
    Ummm...this is most likely the problem. Why a timer?
    Why not just call refresh every time you've drawn the
    form or when there's no incoming events. Doing this
    asynchronously can only lead to problems.


    --
    <\___/>
    / O O \
    \_____/ FTB. For email, remove my socks.

    In science it often happens that scientists say, 'You know
    that's a really good argument; my position is mistaken,'
    and then they actually change their minds and you never
    hear that old view from them again. They really do it.
    It doesn't happen as often as it should, because scientists
    are human and change is sometimes painful. But it happens
    every day. I cannot recall the last time something like
    that happened in politics or religion.

    - Carl Sagan, 1987 CSICOP keynote address

    Comment

    • Mark Thompson

      #3
      Re: OpenGL Refresh problem using CsGL with VB.NET

      Fungus,

      Thank you for your advice. However, I had already tried a few different
      ways of doing this, persistent loop on the form load event, firing only
      when triggered by move events etc. and the problem still occurs on some
      systems.

      It does feel though as if there is something fundamentally wrong
      somewhere as presumably OpenGL can be successfully used with VB.NET to
      create applications like the one we are producing?

      Any other ideas?

      Mark.

      Comment

      • fungus

        #4
        Re: OpenGL Refresh problem using CsGL with VB.NET

        Mark Thompson wrote:
        >
        Any other ideas?
        >
        What are you passing as "dwStyle" in CreateWindow()?


        --
        <\___/>
        / O O \
        \_____/ FTB. For email, remove my socks.

        In science it often happens that scientists say, 'You know
        that's a really good argument; my position is mistaken,'
        and then they actually change their minds and you never
        hear that old view from them again. They really do it.
        It doesn't happen as often as it should, because scientists
        are human and change is sometimes painful. But it happens
        every day. I cannot recall the last time something like
        that happened in politics or religion.

        - Carl Sagan, 1987 CSICOP keynote address

        Comment

        Working...