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

Thread: Screen refreshes when another window is displayed above it

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2002
    Location
    UK
    Posts
    5

    Screen refreshes when another window is displayed above it

    I have just started OpenGL and have written a basic program that displays random shapes.

    If I drag a different window over the window or hover the mouse over the minimise or maximise buttons on the window the screen refreshes (and new shapes appear).

    I tried using a variable which incremented when the procedure was run and the procedure would only run if it was below 1 which works fine for the min/max problem but when I drag a new window over it draws it on and it stays due to it not refreshing.

    Is there any way of redrawing the screen with the original image but without running my display procedure which creates new images.

    Thanks in advance.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: Screen refreshes when another window is displayed above it

    Would have to look at your code, but I would think that you have the routines that change your display in your display routine.


    Best to not have anything but drawing code in the display() routine and keep drawning changes done in a control loop.

    This way when the display is called after a window event, only the last data is redisplayed and not new data created.


    Originally posted by rickp101:
    I have just started OpenGL and have written a basic program that displays random shapes.

    If I drag a different window over the window or hover the mouse over the minimise or maximise buttons on the window the screen refreshes (and new shapes appear).

    I tried using a variable which incremented when the procedure was run and the procedure would only run if it was below 1 which works fine for the min/max problem but when I drag a new window over it draws it on and it stays due to it not refreshing.

    Is there any way of redrawing the screen with the original image but without running my display procedure which creates new images.

    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
  •