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) » [Proposal] Adding a GLLock struct to GLCtrl
Re: [Proposal] Adding a GLLock struct to GLCtrl [message #54728 is a reply to message #54719] Thu, 03 September 2020 23:46 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Xemuth and Mirek,

We should think about the drawback of this addition:
- maintenance (current implementation delivered by Xemuth can be simplify, however still the implementation will need to be provided when adding new platform).
- concurrent solution (one thing can be done using two different approach - my solution is better than yours (code review problem))

Drawbacks:
- no need to open new additional layer of indentation
- more...

Backing to the "new layer of indentation", you could always call new function (which will make original one smaller):
	bool LoadSTL(){ //This function is used when a button is pressed
            bool rendered;
            canvas.ExecuteGL([&] { rendered = renderSTL(); });
            return rendered;
            
            // Maybe with template magic we could simplify to
            // return canvas.ExecuteGL([&] -> bool { return renderSTL(); });
	}

	bool rednerSTL() {
                // All methods calls from here could call to OpenGL... The same is true with lock approach...
                try {
                        //Context is here...
		        //Shaders Stuff
		        //OpenGL buffer filling and loading 
		        //Definition of draw
		} catch (Exc e) {
			Exclamation(DeQtf(e));
		}
		return false;
	}


I do not have strong opinion and the solution seems to have more drawbacks than pluses. Would be nice investigating, how we can extend ExecuteGL to return custom types.

Klugier


U++ - one framework to rule them all.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Changing default standard from c++14 to c++17 (2020.2 Release)
Next Topic: RegExp
Goto Forum:
  


Current Time: Mon Apr 29 14:13:01 CEST 2024

Total time taken to generate the page: 0.01859 seconds