CEGUI and WxMax

BlitzMax Forums/Brucey's Modules/CEGUI and WxMax

Retimer(Posted 2009) [#1]
Is there a work around for this as of yet?


Brucey(Posted 2009) [#2]
Work around for what?


Retimer(Posted 2009) [#3]
Using cegui in a wxmax control (canvas)?

i'm able to get it working ok using maxguiex, but with wxmax I get the opengl driver error, as it's not compatible it seems.

edit:

OpenGLRenderer failed to initialise the GLEW library. Missing GL version



Brucey(Posted 2009) [#4]
Well, I've got it rendering no problem... but there appears to be a bug with the Eventhooks where EmitEventHook is returning 0 on the call to AddHook EmitEventHook,TCEEvent.Keyhook,Null,0 in CEGUI.
So, I'm working out a way to include a "different" event handler, which will work here.

I'll post code when it's done :-p


Brucey(Posted 2009) [#5]
Drop this in the raknet examples folder to test (without having to change the CEGUI scheme/datafile stuff).
You'll also need to update CEGUI. I've added a second param to CEGUI_init() which disables the built-in event handling, since it wasn't working here with wxMax (Looks like a bug with AddHook tbh).

Seems to work on Mac. Not tested elsewhere yet.



Yes, the event stuff is pretty hefty. It's always there (in Max2D etc), but that's usually hidden away from you - what you don't know about won't hurt you, eh?
Here I'm passing events to both Max2D and CEGUI. (except of course we're using my wx version of GLMax2D - because we need to use our own GL implementation - Had Mark used Factories, like he has with image loaders and the likes, we could have done this all a bit more tidier... oh well).

Obviously this is just a hacked together mess, but it shows the two running together. :-)


Retimer(Posted 2009) [#6]
I'm understanding what's going on in the code, however i'm hitting an error:

TCESystem.injectTimePulse(elapsed)

>

Function injectTimePulse(time:Float)
	bmx_cegui_system_injectTimePulse(cegui_systemPtr ,time)
End Function


Commenting out the line just ends up giving me an error from mouse injection. I have the latest cegui from the svn built. And I altered the helper.layout to my own since I don't have it, although that shouldn't be the issue as before the error I can see the layout loading properly.


Brucey(Posted 2009) [#7]
Here's a wee update :



It seems on Windows, OnMouse can be called before the window has finished initialising - don't ask... I don't know!
So in effect, we were trying to inject mouse movement into non initialised CEGUI...
The actual change is this, in the OnMouse function :
	If MyCanvas(event.parent).initialized Then


And yes, the mouse isn't hiding on Windows... I believe I know why, but am not too concerned about it for now. :-p


Retimer(Posted 2009) [#8]
Thanks brucey! Exactly what I was looking for.

And yes, the mouse isn't hiding on Windows... I believe I know why, but am not too concerned about it for now. :-p


Yeah, I wasn't aware of a similar function in wxmax, but this did what I needed:

Local Cursor:wxCursor = New wxCursor.CreateWithImage(New wxImage.CreateEmptyImage(1, 1))
Self.SetCursor(Cursor)



Retimer(Posted 2009) [#9]
I'm not sure if this is related to wxGLGraphicsDriver() or not, but the gui's font looks all chopped and gargled when initially loaded, but even worse after minimizing and bring it back up.

As far as I can tell it doesn't seem to affect the gui itself, just the fonts. I think I ran into a similar problem using maxgui as well.

I would ask in the cegui forum but I haven't a clue whether the issue is with blitzmax or cegui.

An image of what is happening here.

First image is fine, not on maxgui or wxmax windows.
Second image is loading with wxmax.
Third image is loaded, then minimized, then restored.


Brucey(Posted 2009) [#10]
What about SetBlend ALPHABLEND ?


Ole JR(Posted 2009) [#11]
Another longshot..
Can be gfxcard driver settings?

Atleast here, when I set anti-aliasing to gfx driver controlled,
(ATI catalyst ctrl center), I get the same thing in Blender.
Menutext isn't readable at all.

By setting it to application controlled it's fine..

Might add that menus in Blender aren't "ordinary" windows menus,
but drawn/created by Blender itself..


Retimer(Posted 2009) [#12]
Thanks guys. Using alpha fixed the majority of the issue. It only appears a slight bit blurry after minimizing, but a lot better than before.

I'm willing to bet that the tiny blur is caused by ole's suggestion with my gfx settings somewhere, although anti-alias doesn't appear to be it..i'll keep tinkering with it.

when I set anti-aliasing to gfx driver controlled


Yeah I ran into strange problems with that before as well, along with physx causing some of the weirdest physics jumping where anything moved by input would just disapear.


Brucey(Posted 2009) [#13]
Isn't it possible that the window is not the same size as before, and the canvas is scaling slightly?


Retimer(Posted 2009) [#14]
Doesn't seem to be the case.

However, I have another (hopefully last) question on this...

ConnectAny(wxEVT_CHAR, OnKeyChar)


creates an event on arrow keys and other system keys, injecting invalid characters. Should wxEVT_CHAR be registering on such keys?