Home » U++ Library support » U++ Library : Other (not classified elsewhere) » GLCtrl in TopWindow 
	
		
		
			| GLCtrl in TopWindow [message #41794] | 
			Wed, 22 January 2014 22:45   | 
		 
		
			
				
				
				
					
						  
						NeilMonday
						 Messages: 15 Registered: May 2013 
						
					 | 
					Promising Member  | 
					 | 
		 
		 
	 | 
 
	
		I have a GLCtrl in a TopWindow that works fine the first time, but if I close, and then open the window, the GLCtrl is blank. 
 
I have a Spectrogram class that inherits from GLCtrl. I also have a TopWindow called SpectrogramPanel that has a Spectrogram object in its layout. 
 
LAYOUT(SpectrogramPanelLayout, 1036, 652)
	ITEM(Spectrogram, spectrogram, HSizePosZ(0, 0).VSizePosZ(0, 0))
END_LAYOUT
  
 
struct SpectrogramPanel : public WithSpectrogramPanelLayout<TopWindow>
{
	typedef SpectrogramPanel CLASSNAME;
	
	SpectrogramPanel()
	{
		CtrlLayout(*this);
	}
};
 
 
class Spectrogram : public GLCtrl
{
...
}
 
 
Before I "Execute();" the SpectrogramPanel instance, I first call "SetData(...)" to give it some 3D points to render. 
 
I have implemented the GLInit, GLPaint, and GLResize, and the whole thing works perfectly the first time the window is shown. However, when I close the window, then call "SetData(...)" again with new data, and then "Execute()" the SpectrogramPanel again, I have a blank GLCtrl. I can see the glClear color, but I cannot see the 3D object that I just saw the last time the window was open. 
 
I noticed that "GLInit();" gets called again the second time even though the window never destroyed. I would have expected "GLInit();" to be called only once during the whole lifetime of the GLCtrl. But it looks like "GLInit();" is called everytime the window is "Execute();"d. Any help is appreciated. 
 
This question might be specific to OpenGL and not Ultimate++, but I thought I would start here to see if anyone has any ideas. 
 
Thanks!
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 16:55:01 CET 2025 
 Total time taken to generate the page: 0.17044 seconds 
 |