refreshing scene problem

refreshing scene problem

Post by Ivo Krooswij » Fri, 27 Jun 2003 01:54:47



hi, i have the following problem:

i have a control in a gui which displays my 3d opengl scene
when i move for example a color choosing dialog over the control (for
changing the bgcolor), select a color and close the dialog, the part of the
controls surface the dialog was on, is gray.

i tried an update scene directly after the color confirmation, but it is
does not help. neither when i call it from a WM_PAINT in my control. anybody
recogneizes this problem? what can i do to prevent this.

in my update scene i start doing a glClearColor(..) and a glClear(..) to
apply the new color. after that my model is drawn. finally i do a
SwapBuffers( ).

i hope this is enough information. tnx in advance.

 
 
 

refreshing scene problem

Post by Alex Mizrah » Fri, 27 Jun 2003 06:10:39


Hello, Ivo!
You wrote  on Wed, 25 Jun 2003 18:54:47 +0200:

 IK> hi, i have the following problem:

 IK> i have a control in a gui which displays my 3d opengl scene when i
 IK> move for example a color choosing dialog over the control (for
 IK> changing the bgcolor), select a color and close the dialog, the part
 IK> of the controls surface the dialog was on, is gray.

 IK> i tried an update scene directly after the color confirmation, but
 IK> it is does not help. neither when i call it from a WM_PAINT in my
 IK> control. anybody recogneizes this problem? what can i do to prevent
 IK> this.

 IK> in my update scene i start doing a glClearColor(..) and a
 IK> glClear(..) to apply the new color. after that my model is drawn.
 IK> finally i do a
 IK> SwapBuffers( ).

 IK> i hope this is enough information. tnx in advance.

this is not a normal behaviour. are you sure that rendering is performed and
there are no errors during scene rendering and SwapBuffers? Viewport
includes area of that control?

With best regards, Alex Mizrahi aka killer_storm.

 
 
 

refreshing scene problem

Post by Ivo Krooswij » Sat, 28 Jun 2003 14:57:21


globally seen this is my render_function, it is called every time something
is set on the control.
e.g.  when the background color is changed:

 - In user interface, when pressing a button:

COLORREF red = RGB( 255,0,0 ); // chosen with dialog
my_control->set_color_background( red );

- In my_control :: set_color_background( color_background )

this->color_background = color_background;
this->update_scene( ); // this function calls the render_scene function

void render_scene( )
{
    render_background( );

    if ( dataset_loaded )
    {
        render_model( );
    }

    SwapBuffers( device_context );

Quote:}

this way I always will be able to change the background color, even when the
dataset is not loaded.
the rendering is performed ok, only the background is showed, and when i
load a new dataset, the model is displayed properly on the background.

1. when want to change the background color for the firs time using a color
dialog, it leaves the grey square.
    the second time everything is rendered ok.
2. when i move another window over my control it also always leaves a grey
square.

i initialize my opengl_scene in de constructor of my_control.
i hope this is enough information. tnx.


Quote:> Hello, Ivo!
> You wrote  on Wed, 25 Jun 2003 18:54:47 +0200:

>  IK> hi, i have the following problem:

>  IK> i have a control in a gui which displays my 3d opengl scene when i
>  IK> move for example a color choosing dialog over the control (for
>  IK> changing the bgcolor), select a color and close the dialog, the part
>  IK> of the controls surface the dialog was on, is gray.

>  IK> i tried an update scene directly after the color confirmation, but
>  IK> it is does not help. neither when i call it from a WM_PAINT in my
>  IK> control. anybody recogneizes this problem? what can i do to prevent
>  IK> this.

>  IK> in my update scene i start doing a glClearColor(..) and a
>  IK> glClear(..) to apply the new color. after that my model is drawn.
>  IK> finally i do a
>  IK> SwapBuffers( ).

>  IK> i hope this is enough information. tnx in advance.

> this is not a normal behaviour. are you sure that rendering is performed
and
> there are no errors during scene rendering and SwapBuffers? Viewport
> includes area of that control?

> With best regards, Alex Mizrahi aka killer_storm.

 
 
 

refreshing scene problem

Post by Ivo Krooswij » Sat, 28 Jun 2003 20:16:59


When the dataset is loaded and when I want to take a snapshot i use the
function glReadPixels.
Then I'm saving the the data to a bitmap. the bitmap is created correct size
but it is completely black.

Can this have anything to do with the the refreshing problem, I mean can
e.g. a glClear or a resize_opengl_scene
have anything to do with both problems. This may help me further...


Quote:> hi, i have the following problem:

> i have a control in a gui which displays my 3d opengl scene
> when i move for example a color choosing dialog over the control (for
> changing the bgcolor), select a color and close the dialog, the part of
the
> controls surface the dialog was on, is gray.

> i tried an update scene directly after the color confirmation, but it is
> does not help. neither when i call it from a WM_PAINT in my control.
anybody
> recogneizes this problem? what can i do to prevent this.

> in my update scene i start doing a glClearColor(..) and a glClear(..) to
> apply the new color. after that my model is drawn. finally i do a
> SwapBuffers( ).

> i hope this is enough information. tnx in advance.

 
 
 

refreshing scene problem

Post by Alex Mizrah » Sun, 29 Jun 2003 00:35:59


Hello, Ivo!
You wrote  on Fri, 27 Jun 2003 07:57:21 +0200:

 IK> 1. when want to change the background color for the firs time using
 IK> a color dialog, it leaves the grey square.
 IK>     the second time everything is rendered ok.
 IK> 2. when i move another window over my control it also always leaves
 IK> a grey square.

you should also call render_scene() in response to WM_PAINT(in MFC it's
OnPaint), do you?
in this case there is no need in implicitly calling update function. to
ensure that information is most recent do call Invalidate(0). it's better
that implicit call because system will dispatch only one message if multiple
changes were done.

With best regards, Alex Mizrahi aka killer_storm.

 
 
 

1. Problems with Scene from LW scene (crash)

Hello folks

I'm trying to render a screne from the Lightwave disk (Scoutwalk.lws) and it
constantly crashes my system when I hit the F10 key.
I am able to render a sinlge frame without problems.

I use a PIII with Gforce Graphics card and 256MB ram and Lightwave 6.5b under
Win98. There is no other application running in the background (learned that
the hard way with Animation:Master:)

Does anybody has an idea what could be wrong?

Phil

2. UPDATED : HUD 2.0 Overview Page

3. Hypervoxels {1.0} Refresh, does not Refresh

4. Announcement: ThumbsPlus v3.0g/Thumbnail Web Pages!

5. Painter Refreshing Problem - White Lines

6. using height fields for animating water

7. O2 Maya refresh problem IRIX 6.5.13f

8. FS: 3DStudio Max; 3DS v.4.0; NT 3.51

9. Hidden Refresh problem

10. Screen refresh problems

11. win2k Lw6.5 refresh problem

12. Screen refresh problems

13. Refresh Problems on Win2000?!?!