Real Software Forums
http://forums.realsoftware.com/

Help me Get Started With OpenGL
http://forums.realsoftware.com/viewtopic.php?f=4&t=34534
Page 1 of 1

Author:  8rad [ Wed Jul 07, 2010 3:31 pm ]
Post subject:  Help me Get Started With OpenGL

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).

Author:  jquan [ Thu Jul 08, 2010 6:17 pm ]
Post subject:  Re: Help me Get Started With OpenGL

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!

Author:  8rad [ Fri Jul 09, 2010 4:27 pm ]
Post subject:  Re: Help me Get Started With OpenGL

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.

Author:  jquan [ Fri Jul 09, 2010 6:08 pm ]
Post subject:  Re: Help me Get Started With OpenGL

What have you tried before looking at OpenGL?

Author:  Agent [ Fri Jul 09, 2010 8:16 pm ]
Post subject:  Re: Help me Get Started With OpenGL

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.

Author:  8rad [ Sun Jul 11, 2010 8:22 pm ]
Post subject:  Re: Help me Get Started With OpenGL

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.

Author:  8rad [ Sun Jul 11, 2010 8:26 pm ]
Post subject:  Re: Help me Get Started With OpenGL

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.

Author:  jquan [ Sun Jul 11, 2010 11:19 pm ]
Post subject:  Re: Help me Get Started With OpenGL

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.

Author:  Agent [ Mon Jul 12, 2010 5:44 pm ]
Post subject:  Re: Help me Get Started With OpenGL

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.

Author:  mauitom [ Mon Jul 26, 2010 11:50 pm ]
Post subject:  Re: Help me Get Started With OpenGL

http://web.me.com/mauitom/REALbasic_201 ... penGL.html

--
Thomas C.

Author:  NaNdummy [ Fri Dec 02, 2011 11:04 am ]
Post subject:  Re: Help me Get Started With OpenGL

i would:

videotutorialsrock.com

this is c++ but easy to relearn in rb

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/