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 » OpenGL and continous animation
OpenGL and continous animation [message #14384] Sun, 24 February 2008 19:25 Go to next message
forlano is currently offline  forlano
Messages: 1098
Registered: March 2006
Location: Italy
Experienced Contributor
Hello,

I found http://nehe.gamedev.net where there are nice tutorials covering OpenGL. I followed the first tutorials and I used as skeleton the package refence/OpenGL. All the code of the tutorial finish in GLPaint() method and everything works perfectly.

What I would like to have now is the automatic animation of the picture without to drive it with the mouse done via
	
virtual void MouseMove(Point p, dword) {
		point = p;
		Refresh();
	}


It should be very easy but I am facing problem.
For example I added the callback LeftDown and the method Rotate() that change some parameter of the figure but nothing change in the screen when I leftclick
	virtual void LeftDown(Point p, dword) {
		Rotate();
	}

	void Rotate( ) 
	{ for(int i=1;i<=1000000;i++) {
	 	 rtri+=0.2f; //it is used in GlPaint
	   	 Refresh();
	  }
	}

Instead MouseMove() works fine. What am I missing? Embarassed
(tell me if a testcase is needed although refence/OpenGL with an automatic animation would be ok)

Luigi
Re: OpenGL and continous animation [message #14387 is a reply to message #14384] Sun, 24 February 2008 21:26 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Hi Luigi,

I attached an example I have made with a timer.

By the way, have you tried to run your app in X11?

Matthias
  • Attachment: Example.zip
    (Size: 1.81KB, Downloaded 206 times)
Re: OpenGL and continous animation [message #14391 is a reply to message #14387] Sun, 24 February 2008 23:02 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1098
Registered: March 2006
Location: Italy
Experienced Contributor
masu wrote on Sun, 24 February 2008 21:26

Hi Luigi,

I attached an example I have made with a timer.

By the way, have you tried to run your app in X11?

Matthias


Hi Matthias,

thanks a lot for the example.
I've not yet tried it under linux. I'll give a try tomorrow.

Luigi
Re: OpenGL and continous animation [message #14398 is a reply to message #14387] Mon, 25 February 2008 13:51 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1098
Registered: March 2006
Location: Italy
Experienced Contributor
masu wrote on Sun, 24 February 2008 21:26


By the way, have you tried to run your app in X11?

Matthias


I tried in Ubuntu but I was not able to compile your code. It does not find GL/gl.h etc... Under linux I've not the latest dev version and maybe I should install the openGL too.
I should update it but I use U++-linux rarely.

Luigi
Re: OpenGL and continous animation [message #14399 is a reply to message #14398] Mon, 25 February 2008 14:04 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
It would be nice if you can check it with Linux since I have problems with X11 GLCtrl implementation.
I get a window handle error when GLCtrl window is mapped to X11 window.

Thanks,
Matthias
Re: OpenGL and continous animation [message #14400 is a reply to message #14399] Mon, 25 February 2008 14:56 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1098
Registered: March 2006
Location: Italy
Experienced Contributor
masu wrote on Mon, 25 February 2008 14:04

It would be nice if you can check it with Linux since I have problems with X11 GLCtrl implementation.
I get a window handle error when GLCtrl window is mapped to X11 window.

Thanks,
Matthias


I've Ubuntu. Do you know if the openGL library come with U++ or I should install it from a thirth part? At the moment there are many gl...h not found.

Luigi
Re: OpenGL and continous animation [message #14401 is a reply to message #14384] Mon, 25 February 2008 15:36 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 805
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor

try to look in synaptic (or what package manager you use) for opengl libraries, especially for packages with "*dev" at end.
Re: OpenGL and continous animation [message #14402 is a reply to message #14401] Mon, 25 February 2008 15:56 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1098
Registered: March 2006
Location: Italy
Experienced Contributor
mr_ped wrote on Mon, 25 February 2008 15:36

try to look in synaptic (or what package manager you use) for opengl libraries, especially for packages with "*dev" at end.


OK, I installed Mesa and compiled the reference test case and the Matthias' package. Both compile without problem but do not show anything. The error message in the opened window is:
"GLCtrl: CreateGLXWindow: impossible to find a suitable visual"

I can run other test package if this can help. Please consider that my linux Upp-dev version is before of 2008, perhaps the december version. Please post o pm to me the most updated GL package if you want I try it on linux.

Luigi
Re: OpenGL and continous animation [message #14403 is a reply to message #14401] Mon, 25 February 2008 15:57 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Have you compiled it in DEBUG mode?
Regards,
Matthias

[Updated on: Mon, 25 February 2008 15:58]

Report message to a moderator

Re: OpenGL and continous animation [message #14406 is a reply to message #14403] Mon, 25 February 2008 16:16 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1098
Registered: March 2006
Location: Italy
Experienced Contributor
masu wrote on Mon, 25 February 2008 15:57

Have you compiled it in DEBUG mode?
Regards,
Matthias


No, only in release mode. If you think make sense to test even the debug mode I'll try it too.

Luigi
Re: OpenGL and continous animation [message #14407 is a reply to message #14406] Mon, 25 February 2008 16:28 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Thanks Luigi, can you please compile in DEBUG mode, I would like to see if you also get the message I got.
But I am not sure whether the X11 error messages were already implemented in your version.

Matthias
Re: OpenGL and continous animation [message #14410 is a reply to message #14407] Mon, 25 February 2008 19:16 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1098
Registered: March 2006
Location: Italy
Experienced Contributor
masu wrote on Mon, 25 February 2008 16:28

Thanks Luigi, can you please compile in DEBUG mode, I would like to see if you also get the message I got.
But I am not sure whether the X11 error messages were already implemented in your version.

Matthias


I compiled in debug mode and got the same error.

Luigi
Re: OpenGL and continous animation [message #14415 is a reply to message #14410] Mon, 25 February 2008 21:52 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Luigi, thank you for your help.
I fixed the problem I encountered with OpenGL example.
See topic:
http://www.ultimatepp.org/forum/index.php?t=msg&th=3204& amp;start=0&

Matthias
Re: OpenGL and continous animation [message #14416 is a reply to message #14415] Mon, 25 February 2008 21:58 Go to previous message
forlano is currently offline  forlano
Messages: 1098
Registered: March 2006
Location: Italy
Experienced Contributor
masu wrote on Mon, 25 February 2008 21:52

Luigi, thank you for your help.
I fixed the problem I encountered with OpenGL example.
See topic:
http://www.ultimatepp.org/forum/index.php?t=msg&th=3204& amp; amp;start=0&

Matthias


Very good!
Previous Topic: [SOLVED] OpenGL reference example X11 crash
Next Topic: openGL and texture
Goto Forum:
  


Current Time: Tue May 26 15:11:59 CEST 2020

Total time taken to generate the page: 0.01514 seconds