Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
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 next 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))
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!
Re: GLCtrl in TopWindow [message #41800 is a reply to message #41794] Thu, 23 January 2014 08:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
This might well be a bug in U++. I guess nobody tried to reopen GLCtrl woindow.

What is your OS?

Also, testcase would be helpful...

Mirek
Re: GLCtrl in TopWindow [message #41801 is a reply to message #41800] Thu, 23 January 2014 13:59 Go to previous messageGo to next message
NeilMonday is currently offline  NeilMonday
Messages: 15
Registered: May 2013
Promising Member
I am running on Windows 7 64-bit and am compiling with MSVC 10 (32-bit). Also, I am using GLEW(http://glew.sourceforge.net/) with my GLCtrl.

I will create a very simple test case and upload it today.
Re: GLCtrl in TopWindow [message #41803 is a reply to message #41794] Thu, 23 January 2014 15:32 Go to previous message
NeilMonday is currently offline  NeilMonday
Messages: 15
Registered: May 2013
Promising Member
So, I modified the GLCtrl example so that the GLCtrl is inside a top window that gets dismissed and re-opened and it works fine Embarassed. So, I will build up that simple example until it exhibits my problem and hopefully that will narrow it down.
Previous Topic: ScatterDraw SetLegendWidth() is removed
Next Topic: Curious code in GtkEvent.cpp
Goto Forum:
  


Current Time: Fri Mar 29 02:03:35 CET 2024

Total time taken to generate the page: 0.01106 seconds