Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Nov 20, 2019 12:19 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Wed Feb 25, 2009 6:39 pm 
Offline
User avatar

Joined: Tue Oct 25, 2005 1:57 pm
Posts: 332
JeremK wrote:
I've downloaded it, opened the project, and tried it in the debugger.
Each time it crashed when opening.

So I created a new Window, set its super property to OpenGLDisplay.
Then I added a control
And when debugging this new window it doesn't work either.

I am using RB 2008r4.2 on Windows Vista 32 bits



I have had the same thing happen until I witched to an older version of RB. It works for me for 2008r2 or older.

_________________
http://freeware.the-meiers.org
http://opensource.the-meiers.org


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sat Feb 28, 2009 4:23 pm 
Offline

Joined: Fri Dec 16, 2005 10:19 pm
Posts: 493
Works great for me (mac). Blake, looks like FG is finally ready to head over to openGL (I want shaders for making planets), and I will be looking into these controls with great interest.

I haven't tried to do much other than just run your app, but this looks really promising. Thank you!

I don't see any contents on the tab-panel, but everything else seems correct.

When I have more time I will be back with questions I'm sure.

Thanks again.

Edit: Using rb 2008r5

_________________
- Craig Macomber -
See my rb apps at:
http://www.spincraftsoftware.com/
Lead Programmer for Fragmented Galaxy, an MMORTS:
http://f-g.wikidot.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sat Feb 28, 2009 6:33 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Yeah, the tab panal was last minute, I didn't plan on having it in with the original controls but I just started programming and I'm sure you know how that goes ;)

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sat Feb 28, 2009 8:33 pm 
Offline

Joined: Fri Dec 16, 2005 10:19 pm
Posts: 493
Blake wrote:
Yeah, the tab panal was last minute, I didn't plan on having it in with the original controls but I just started programming and I'm sure you know how that goes ;)


Yep. Anyway, it shouldn't be hard to draw the controls using images should it? The FG project has a nice collection of control graphics we would like to use.

For swapping between sets of controls (Main menu, different play modes, what ever) you could use a full window page panel (no tabs displayed). That would allow for easy layout of all the controls in the IDE. I'll talk to FG's interface guy as see what he thinks.

I'll have to explore your OpenGL setup some more. It looks nice.

Incase anyone is wondering, the reason it runs at about 33 fps is not because that is as fast as it can go, but rather because it is limited to that in code. Runs at 60 fps just fine if not limited.

_________________
- Craig Macomber -
See my rb apps at:
http://www.spincraftsoftware.com/
Lead Programmer for Fragmented Galaxy, an MMORTS:
http://f-g.wikidot.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sun Mar 01, 2009 2:00 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
It could be adapted to use images as the background for the controls, I am actually pondering how to go about customizable controls as far as pictures for borders/backgrounds/etc...

Right now I am thinking everything should be in one image and broken down for each control, I think that might need an external editor of sorts to work properly. Any input is welcome.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sun Mar 01, 2009 2:12 pm 
Offline

Joined: Fri Dec 16, 2005 10:19 pm
Posts: 493
Blake wrote:
It could be adapted to use images as the background for the controls, I am actually pondering how to go about customizable controls as far as pictures for borders/backgrounds/etc...

Right now I am thinking everything should be in one image and broken down for each control, I think that might need an external editor of sorts to work properly. Any input is welcome.


I do happen to have a partially implemented xml and rbScript based control layout system which you simply toggle a boolean and it switches from being a interface to being editable. It could be finished and used instead of the RB IDE to lay out the controls and dictate what they do. If we got that working, it would be pretty neat.

Another approach would be to drag all the images onto the project and select them in the properties list for the controls, or simply type in the images external names. We could also request the images in events and just make project specific subclasses of everything for the different appearances (and use the current vector setup of no images are supplied)

_________________
- Craig Macomber -
See my rb apps at:
http://www.spincraftsoftware.com/
Lead Programmer for Fragmented Galaxy, an MMORTS:
http://f-g.wikidot.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sun Mar 01, 2009 6:44 pm 
Offline

Joined: Thu Apr 10, 2008 6:03 am
Posts: 303
Location: Paris-La Défense, France
I'm actually going through all the initialization process when opening the Control window.

First of all, Background.tga is assumed to always be there. As I'm using RB 2008r4, the debug app isn't in the same folder as the project.
The app crashes on line 13 of OpenGLTexture.LoadFromTargaFile

I commented "Me.LoadFromTargaFile( GetFolderItem( "Background.tga" ) )"
And now it works.

_________________
Check my Website for high quality custom controls and classes (no plugins) for Windows, Mac OS and Linux
REALBasic 2012 R2 on Win 7 & Mac OS X


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Tue Mar 03, 2009 1:19 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Oops, sorry, I forgot I should never make assumptions like that :)

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sat Mar 07, 2009 10:47 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Fishy wrote:
I do happen to have a partially implemented xml and rbScript based control layout system which you simply toggle a boolean and it switches from being a interface to being editable. It could be finished and used instead of the RB IDE to lay out the controls and dictate what they do. If we got that working, it would be pretty neat.

Another approach would be to drag all the images onto the project and select them in the properties list for the controls, or simply type in the images external names. We could also request the images in events and just make project specific subclasses of everything for the different appearances (and use the current vector setup of no images are supplied)


The thing about OpenGL is that all of the images have to have widths/heights of the power of 2 (ie: 2x2, 64x64, 128x64) so I am going to have to think a little more before I can do anything.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sat Mar 07, 2009 11:45 pm 
Offline

Joined: Fri Dec 16, 2005 10:19 pm
Posts: 493
Blake wrote:
The thing about OpenGL is that all of the images have to have widths/heights of the power of 2 (ie: 2x2, 64x64, 128x64) so I am going to have to think a little more before I can do anything.


There are a few approaches that I am aware of. One is simply using the smallest image that can contain the one you are displaying, and set the UVs to the right part shows. You can also a mask to only display the right part of the image instead.

I think I have decided how I would like to the user-interface setup to work:
Partition the interface into GUI modules (Ex: A chat module, a health display module etc). Layout all the modules in windows (container controls would work, but require RB Pro) then read a simple external file that says where to put which modules. Have one such file for each of the sets of stuff you need to display (Main menu, in game controls, etc). Later support could be added for nested modules (Putting modules in other modules like making a dragable window module and putting stuff in it) and more complex things.

I would be happy to dive in and implement this, but I'm pretty busy and will continue to be so for a few weeks, so I can't do it too soon.

Here is how I would implement it: I would allow controls to contain arrays of controls by making a special GLContainerControl. I would then subclass it to make to make a version that gets its contents from an invisible window (so it is easy to lay out). Later we could make a subclass that reads in XML and RBScript to allow fully custom modules.

Then I would write a method that reads a simple text file and creates and positions all the modules (optionally within another module).

I would also make the text file point to all the images that module needs. The format could be like this:
Position left 0
Position top 0
Image buttonUpperRightCorner button/UpperRight.tga
....
We could optionally support an xml version in addition, but I don't see a reason to.

I have some code that allows positioning by any valid combination of right, left, top, bottom, height, and width in px or % (assuming centered if no position specified). It works pretty well (but took a surprisingly large amount of code and error checking!) It should be easy to adapt to our needs.


If you can get the images working, I will be happy to implement what I have described here when I have time and open source the result unless some surprising issue comes up.

_________________
- Craig Macomber -
See my rb apps at:
http://www.spincraftsoftware.com/
Lead Programmer for Fragmented Galaxy, an MMORTS:
http://f-g.wikidot.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sat Mar 07, 2009 11:58 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Quote:
We could optionally support an xml version in addition, but I don't see a reason to.

If you want to be able to easily extend your approach - such as add nested controls, etc. - then you'd want to use xml. It will save you a lot of headaches later.

Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Sun Mar 08, 2009 8:13 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Just uploaded a newer version, fixed a couple things, added some comments in the tab panal.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Thu Mar 19, 2009 10:26 pm 
Offline

Joined: Sun Dec 16, 2007 4:41 pm
Posts: 151
This is great! Thanks for making it.


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Wed Apr 15, 2009 10:54 am 
Offline
User avatar

Joined: Sat Jun 16, 2007 11:37 pm
Posts: 93
Location: Oxford, NC USA
This is cool stuff Blake! Thanks for sharing this. I had a rather long break from RB sadly (did dev work in .NET) and am returning back to RB to make some new stuff. This will come in handy :)

_________________
-- computercoder


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Controls [Open Source]
PostPosted: Tue May 26, 2009 4:49 pm 
Offline

Joined: Thu Apr 02, 2009 7:03 am
Posts: 43
Hi Blake,

I've just downloaded your controls and have managed to get them working in my own project without too much effort. Very nice. Thanks for taking the time to develop them..

One thing I haven't been able to find however is the ability to add light sources. Do you have an example of how this has been implemented in your controls?

Thanks

Chris


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next

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