Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Jun 23, 2017 9:02 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Help me Get Started With OpenGL
PostPosted: Wed Jul 07, 2010 3:31 pm 
Offline

Joined: Thu Jun 17, 2010 2:49 pm
Posts: 83
Could someone help me get started with OpenGL? What I need you to do, is post a link to some RB code or project that demonstrates the following:

how to make an image move across the screen using OpenGL.

I think this would greatly benefit the community (and myself).

_________________
RealStudio user.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Thu Jul 08, 2010 6:17 pm 
Offline

Joined: Mon Feb 05, 2007 11:35 am
Posts: 98
Not to sound negative, but this seemingly simple request isn't really that simple to answer. There is no single definitive method and there are lots of ways to approach this, and even worse: the easiest-looking OpenGL code is actually the slowest way to implement it (just to be clear, I mean glBegin/glEnd stuff)!

I will point you to Nehe's lessons starting at http://nehe.gamedev.net/lesson.asp?index=01 that have REALbasic code that should get you started (they run up to lesson 6, which covers texture mapping). That's how I started writing my GL classes at http://www.jcquan.com/REALbasic and I learned lots (heck, I'm still learning!).

You might find Blake's OpenGL classes a good way to learn (they're six of them in this Games forum as of this writing), as they break things down into more easily-digestible chunks.

Good luck!

_________________
Regards,

Jeff Quan
jeff@jcquan.com
http://www.jcquan.com/JQportfolio
My RBGL replacement classes: http://www.jcquan.com/REALbasic


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Fri Jul 09, 2010 4:27 pm 
Offline

Joined: Thu Jun 17, 2010 2:49 pm
Posts: 83
It's time to reveal the truth: the only reason I want to learn OpenGL is to move an image smoothly across the screen. All of the most obvious (to me) solutions I've tried resulted in the image being somewhat flickery.

_________________
RealStudio user.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Fri Jul 09, 2010 6:08 pm 
Offline

Joined: Mon Feb 05, 2007 11:35 am
Posts: 98
What have you tried before looking at OpenGL?

_________________
Regards,

Jeff Quan
jeff@jcquan.com
http://www.jcquan.com/JQportfolio
My RBGL replacement classes: http://www.jcquan.com/REALbasic


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Fri Jul 09, 2010 8:16 pm 
Offline

Joined: Fri Sep 30, 2005 11:19 am
Posts: 275
8rad wrote:
It's time to reveal the truth: the only reason I want to learn OpenGL is to move an image smoothly across the screen. All of the most obvious (to me) solutions I've tried resulted in the image being somewhat flickery.


OpenGL seems a bit overkill for that, if you use a canvas (or similar) - make sure you double buffer.

_________________
"If you look carefully at my lips, you'll realize that I'm actually saying something else."
Brainswitch Machina - REALStudio/REALbasic
RBScriptExtender - give RBScript power to work with any class


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Sun Jul 11, 2010 8:22 pm 
Offline

Joined: Thu Jun 17, 2010 2:49 pm
Posts: 83
Before I've tried using an Image or a Canvas and moving it across the screen every time a timer goes off (which is set to 0, ie as fast as it can). I also tried downloading a class that another person made, ZAZ OpenSource Animation Kit, and it was not any smoother.

When I did this in C# before I also noticed flicker. The best way to fix the problem was to set an event listener for "Application.Idle". This is the best way in C# that I know of to get an event called as soon as the CPU is done running your code. Otherwise it's just not getting called often enough, or something behind the scenes is slowing the drawing down enough so that I get flicker.

_________________
RealStudio user.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Sun Jul 11, 2010 8:26 pm 
Offline

Joined: Thu Jun 17, 2010 2:49 pm
Posts: 83
Also, this only needs to happen on Linux. I was reading another thread here on flickering and the Real Software CEO said that Linux is better than Windows for flickering. This application needs to be the smoothest-looking image-movement possible. Much more so than what games or almost any other program would require. I don't know if I want to reveal what it is I'm doing, but if I did you would be like "Oh, d---, that does require silky smooth animation.

_________________
RealStudio user.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Sun Jul 11, 2010 11:19 pm 
Offline

Joined: Mon Feb 05, 2007 11:35 am
Posts: 98
Moving the Canvas itself is usually not the answer. Try moving pixels within a stationary Canvas.

And as Agent said, double-buffering will take care of any flickering on any platform.

_________________
Regards,

Jeff Quan
jeff@jcquan.com
http://www.jcquan.com/JQportfolio
My RBGL replacement classes: http://www.jcquan.com/REALbasic


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Mon Jul 12, 2010 5:44 pm 
Offline

Joined: Fri Sep 30, 2005 11:19 am
Posts: 275
8rad wrote:
Before I've tried using an Image or a Canvas and moving it across the screen every time a timer goes off (which is set to 0, ie as fast as it can).


Try using a thread instead, usually works better.

_________________
"If you look carefully at my lips, you'll realize that I'm actually saying something else."
Brainswitch Machina - REALStudio/REALbasic
RBScriptExtender - give RBScript power to work with any class


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Mon Jul 26, 2010 11:50 pm 
Offline
User avatar

Joined: Thu Feb 16, 2006 10:04 pm
Posts: 262
http://web.me.com/mauitom/REALbasic_201 ... penGL.html

--
Thomas C.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help me Get Started With OpenGL
PostPosted: Fri Dec 02, 2011 11:04 am 
Offline

Joined: Thu Dec 01, 2011 2:13 pm
Posts: 288
i would:

videotutorialsrock.com

this is c++ but easy to relearn in rb

_________________
Mac OS X 10.3-10.8
Windows 2000 (I know it sucks)
Windows Server 2007

You want a bunch of new classes and web styles? realstudiodevspot.com (search there for Web Styles Plugin)
Folderitem is too hard? File Bin Class
I hate cows.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group