Announcement

Collapse
No announcement yet.

graphics not completing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • graphics not completing

    Hi,

    I'm relatively new to PBCC (but experienced at VB6 and Basic PDS). I'm doing a program that does dialog with the user in a console window and
    shows graphics in a graphic window. The graphics involve constructing 11 curves with about 150 straight line segments each. The straight line segments are done with a GRAPHIC LINE statement that is reused repeatedly. Everything compiled OK. However, when the program was run, sometimes segments of curves or entire curves were missing.

    I noticed when I inserted some print statements in the loop to help debug, the problem seldom happened. It occurred to me that the delay caused by the print statements actually was solving the problem. So, I put in a time waster in the loop (FOR i% = 1 to n%, NEXT i%). The time waster runs for each line segment. When I got n% up to 1000000, the problem became uncommon; at 2000000, it disappeared. Program execution speed was acceptable. SLEEP 1 slowed the program too much, but worked too.

    I can't help but think the problem is a flaw in PBCC, but perhaps it's the OS (WinXP). I worry that the time waster loop will be too much or too little on machines other than my own. Comments or suggestions?

    My OS is Win XP.

  • #2
    There are a small number of video drivers which do not handle reentrant commands correctly. Looks like you found one. If you just use the REDRAW option to GRAPHIC ATTACH, everything should work fine. We're looking into additional options. Thanks!

    Bob Zale
    PowerBASIC Inc.

    Comment


    • #3
      Hi,

      the problem can be workarouned like:
      Code:
      ' -- Attaches graphic window in double buffer mode
      GRAPHIC ATTACH hWin, 0, [B]REDRAW[/B]
      
      '
      ' - draw the lines here, as many as you want -
      '
      
      ' -- Flushes updating of GRAPHIC window with statements you have sent to draw
      [B]GRAPHIC REDRAW[/B]
      Good news is that this way you get usually better performance than in single buffer mode.


      Petr
      [email protected]

      Comment


      • #4
        Bob and Petr,

        Using REDRAW worked great. Thanks for the help.
        BTW, the video board is Nvidia GeForce4 MX 420 with the 5.2.16 driver.

        Mike

        Comment


        • #5
          Originally posted by Michael Bruss View Post
          Bob and Petr,

          Using REDRAW worked great. Thanks for the help.
          BTW, the video board is Nvidia GeForce4 MX 420 with the 5.2.16 driver.

          Mike
          Hi Mike,

          You might like to review another thread, "Odd failures of graphic display," which appears to be dealing with the same fundamental problem. That discussion seems to implicate an nvidia card/driver. Sleep statements cured the problem for me, but REDRAW didn't seem to. Others report REDRAW cures the problem.

          PB Support send me my own code compiled with a modified compiler. It does not show the problems I get with the same code compiled on my machine. They seem to have a good idea they are developing.

          Bruce
          Bruce L. Bachelder
          www.BruceBachelderPhD.com

          Comment


          • #6
            Nvidia drivers

            Bruce,

            My worst affected machine is a all Intel computer ( brand new dual core ) that needed a big SLEEP delay to fix it.
            So the bug is not limited to Nvidia. I also got PB Support new compiled code and it did fix all my computers.
            Old QB45 Programmer

            Comment


            • #7
              Pbcc 5.0

              I guess that the new compiler was the one used to fix our problem.
              I sent my order for it yesterday.

              Thanks Bob, I can't wait to try it
              Old QB45 Programmer

              Comment

              Working...
              X