Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site
Search in forums

SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » GLCtrl in TopWindow
GLCtrl in TopWindow [message #41794] Wed, 22 January 2014 22:45 Go to previous message
NeilMonday is currently offline  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))

struct SpectrogramPanel : public WithSpectrogramPanelLayout<TopWindow>
	typedef SpectrogramPanel CLASSNAME;

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.

Read Message
Read Message
Read Message
Read Message
Previous Topic: ScatterDraw SetLegendWidth() is removed
Next Topic: Curious code in GtkEvent.cpp
Goto Forum:

Current Time: Thu Oct 29 00:33:11 CET 2020

Total time taken to generate the page: 0.00841 seconds