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++ Core » [FIXED] GLDraw,GLCtrl would be nice to work properly (OpenGL ver must be >= 2.1 with full-caps)
Re: GLDraw,GLCtrl would be nice to work properly [message #58620 is a reply to message #58618] Mon, 04 July 2022 23:36 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 1077
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

Commenting SysImageRealized doesn't help. Also, commenting w.DrawImage(), too. What helped is commenting loop with angle:
		//for(int angle = 0; angle < 360; angle += 30)
		//	w.DrawText(sz.cx - sz.cx / 3, sz.cy - sz.cy / 3, angle * 10, "x   Text with angle " + AsString(angle));
		


So, following code works fine on 32-bit windows:
	virtual void GLPaint() {
		Size sz = GetSize();
	
		GLDraw w;
		
		w.Init(sz);

		w.DrawRect(0, 0, sz.cx, sz.cy, SWhite);
		w.DrawRect(10, 10, 30, 30, SRed);
		w.DrawLine(45, 45, 80, 120, 4, Blue);
		w.DrawLine(80, 90, 400, 0, PEN_DASHDOT);
		
		w.DrawImage(200, 10, CtrlImg::reporticon());
		w.DrawImage(280, 10, CtrlImg::reporticon(), Red());
		
		const char *text = "This text is centered";
		Size tsz = GetTextSize(text, Arial(25).Bold());
		
		w.DrawText((sz.cx - tsz.cx) / 2, (sz.cy - tsz.cy) / 2, text, Arial(27).Bold(), SBlue);
		w.Clipoff(200, 50, 95, 100);
		w.DrawText(0, 80, "CLIPPED", Roman(25));
		
		//for(int angle = 0; angle < 360; angle += 30)
		//	w.DrawText(sz.cx - sz.cx / 3, sz.cy - sz.cy / 3, angle * 10, "x   Text with angle " + AsString(angle));
		
		w.End();
	}

------------------
OK, after digging more AsString(angle) is causing crash. It works good with following line of code:
w.DrawText(sz.cx - sz.cx / 3, sz.cy - sz.cy / 3, angle * 10, "x   Text with angle " /*+ AsString(angle)*/);

Replacing AsString with IntStr cause the same error. I think the problem must be with utoa32 (Format.cpp) function and it's memory management on 32 bit architecture.

Klugier


U++ - one framework to rule them all.

[Updated on: Tue, 05 July 2022 00:01]

Report message to a moderator

 
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
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to create a hidden folder?
Next Topic: is memsetex really at optimal speed?
Goto Forum:
  


Current Time: Mon Jun 17 15:02:12 CEST 2024

Total time taken to generate the page: 0.01695 seconds