IGlass and Grey Aliens Framework

BlitzMax Forums/BlitzMax Programming/IGlass and Grey Aliens Framework

Cartman(Posted 2007) [#1]
Has anyone used both IGlass and Grey Aliens Framework together in a game? I'm wondering what problems people have run into with reguard to overlap in the code. I've used both separatly, but I'm looking to combine them and wanted to know if there are areas that may conflict.

Thanks


Filax(Posted 2007) [#2]
If you can use standar bmax 2D functions, i think that not a problem tu use iglass with a framework ? :)


Arowx(Posted 2007) [#3]
Hi I'd be interested to see how they get on although I can't see any major problems unless there is an issue with the drawing order, e.g. Framework under (draws before IGlass).

On a side line has anyone worked on the IGLass Studio code, the version I have looks gorgeous but seems to be a bit unstable (I think it's version 0.8) ?

Hey a combined Framework and IGlass editor would be cool, there I go again daydreaming!

Cheers

Merx


Grey Alien(Posted 2007) [#4]
I've never used IGlass I'm afraid, I don't even know what it is! A GUI I guess...


Cartman(Posted 2007) [#5]
Merx,

That's exactly my concern. They both have their own drawing routines and I'm conerned about how to get them to work together.

Grey,
IGlass has alot of GUI elements and makes them very easy to use.

A combination of your great framework (which handles all the idiosyncrasies around blitzmax and getting it to play well in Windows) and IGlasses very cool library of GUI controls would be a great marriage.

I'll probably do some experiments with it and see what I can come up with.


TaskMaster(Posted 2007) [#6]
Why wouldn't they both work? Just have the one you want to draw on top do its drawing last.


Grey Alien(Posted 2007) [#7]
Yeah try just modifying TGame.ScreenDraw() and calling the IGlass draw at the point you feel is appropriate. Probably before ShowPaused()

Does the GUI using any timing or counters at all, like Delta time etc?


Filax(Posted 2007) [#8]
Absolutly not :) just pure 2D blitzmax command.


Cartman(Posted 2007) [#9]
OK. That's all I needed to know. I'll begin tinkering with them soon.


Arowx(Posted 2007) [#10]
Hi Gents, just added some IGlass demo code to my current prototype and got a really messed up UI. Not sure whats going on but will look into it...

Setting Blend to Alpha was the main problem needed to be reset to Solid before calling on IGL_RefreshGui().


Grey Alien(Posted 2007) [#11]
Sounds like a good tip. Most stuff in my framework is drawn with alpha blend unless you override it.


Cartman(Posted 2007) [#12]
I can't get any of the MouseEvent funtionality in Iglass to work. Anyone know of a way to turn off the mouse monitoring that's going on in the Framework, so that I can just let Iglass do it?


Grey Alien(Posted 2007) [#13]
It's probably because of TGame.DoPeekEvent() which intercepts the mouse events to read them into the TMousePointer coords, and also the button presses. Hmm, you really need that function in my framework. Is there a way to "reraise" events so that IGlass can pick them up? I presume IGlass has some kind of logic call that's separate from the draw? It would need to be called AFTER DoPeekEvent if you reraised the mouse events. Or maybe you can find out where IGlass stores it's mouse coords (or if it reads them "live") and overwrite those values with the ones read in DoPeakEvent. That would work, probably, I don't have I Glass so I can't say for sure.


Cartman(Posted 2007) [#14]
Correct me if I'm wrong Filax(and I'm wrong alot), but I think the mouse events in IGlass are embedded in the .o files and not accessible from within the .bmx code. The only thing I can figure out so far, is to use the Frameworks mouse calls to tell IGlass how to draw its mouse pointer. It's a hack but it seems to be working for me currently. I'm just looking for something a little cleaner.


Filax(Posted 2007) [#15]
You are right about mouse, but try to look under
the class mouse, if i remember the pointer and
the mouse event are stored and executed here.

But for the rest i'm obliged to rebuild some mouse
events, to be up than a simple mousehit and mousedown
Iglass use is hown vars to check the mouse events.

If i understand there is a conflict between the Grey Alien
framework and Iglass about mouse ?

If you want i can send to you a special Iglass version
without module. To help you to hack mouse code :)


Cartman(Posted 2007) [#16]
Thanks Filax. I'll take a look and see what's going on.


Filax(Posted 2007) [#17]
Glad to ear that :)


Cartman(Posted 2007) [#18]
OK. Here's what I've come up with. You can read the full text here: http://piddlepup.com/node/95

What I did
==========
I started with the TemplateProject.bmx file that comes with the Framework. This is a simple bmx project that simply shows a screen with a little block of a cursor. It uses the base minimum of the Framework. I thought this would be a good start, since my own code has been customized heavily for my game needs and my Mac port. I added to the TemplateProject.bmx code Filax's examples of windows, buttons and input boxes. All of these worked as they did before but now they were in the Framework.

Steps
=====
In TemplateProject.bmx:

1. Add these lines to the Include section of the code:
Include "./IGL_Classe/Inc_IGlass.bmx"
IGL_InitGUI(1)
2. In the LoadData() function, I commented out this line(because it messed up the placement of the buttons and their labels):
AutoMidHandle True
3. In the CleanUp() function, I added this line:
IGL_ClearGui()

In clean_commontypes.bmx:

1. In the TGame:GraphicsCreate() method, comment out this line:
ccDisablePolledInput()
2. In the TGame:ScreenDraw() method, add this line below DebugPrint():
IGL_RefreshGui()

Add any IGlass code you want to run (see the IGlass examples).

Conclusion
==========
These changes are by no means the only ones you'll need to make, however they appear to give me the base functionality. I'm sure there will be more customizations necessary to fix things I've broken in the Framework by reenabling the polledinput, but I believe that will be a small price to take advantage of both of these very helpful libraries.


Grey Alien(Posted 2007) [#19]
Sounds great Keith, thanks for your hard work on this. I've bookmarked this page so I can point people to it in the future.


Filax(Posted 2007) [#20]
I Agree, sound good :)