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++ Widgets - General questions or Mixed problems » [GLCtrl] Adding an Initilisation function to GLPaint
Re: [GLCtrl] Adding an Initilisation function to GLPaint [message #53133 is a reply to message #53125] Fri, 06 March 2020 10:28 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Xemuth wrote on Wed, 04 March 2020 13:28
mirek wrote on Wed, 04 March 2020 13:06
I think the problem is that context is created but not associated with current thread.

Try with ExecuteGL method...



Hello Mirek, you are right, doing this kind of thing work :
void GLCtrl::GLPane::ExecuteGL(HDC hDC, Event<> paint, bool swap_buffers)
{
	static bool HaveBeenInitialised = false;
	wglMakeCurrent(hDC, s_openGLContext);
	if(!HaveBeenInitialised){
		static_cast<GLCtrl*>(parent)->Initialisation();//--> I call Initialisation Here
		HaveBeenInitialised = true;
	}
	paint();
	if(swap_buffers)
		SwapBuffers(hDC);
	else
		glFlush();
	wglMakeCurrent(NULL, NULL);
	
}


mirek wrote on Wed, 04 March 2020 13:06
That said, doing this in GLPaint actually seems fine to me.

Yes, it work aswell but the idea of having a visible boolean just to do some action at the first loop of drawing is disturbing me Twisted Evil (the fix I did in ExecuteGL(...) is basicly the same things but user don't see it Very Happy Is it possible to add it to the GLCtrl code or you prefer stay like that ?

Thanks in advance
Best regard !


For I prefer it to stay as it is....
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SOLVED]Removing glaux lib from GLctrl
Next Topic: How to draw random images in ArrayCtrl-cell using Display? [SOLVED]
Goto Forum:
  


Current Time: Fri Mar 29 08:02:49 CET 2024

Total time taken to generate the page: 0.02297 seconds