CEGUI - Debug Mode Link error with 1.35

BlitzMax Forums/Brucey's Modules/CEGUI - Debug Mode Link error with 1.35

Armitage 1982(Posted 2009) [#1]
Hi Brucey

I'm having a tons of linking error while trying to debug my game with the last BlitzMax 1.35.
I do have rebuild every modules (even twice)

C:/BlitzMax/mod/pub.mod/glew.mod/glew.debug.win32.x86.a(glew_static.c.debug.win32.x86.o):glew_static.c:(.text+0x8746): multiple definition of `glewGetExtension'
C:/BlitzMax/mod/pub.mod/glew.mod/glew.debug.win32.x86.a(glew_static.c.debug.win32.x86.o):glew_static.c:(.text+0xdfe0): multiple definition of `wglewGetExtension'
C:/BlitzMax/mod/bah.mod/cegui.mod/cegui.debug.win32.x86.a(glew.c.debug.win32.x86.o):glew.c:(.text+0xb7f9): first defined here
C:/BlitzMax/mod/pub.mod/glew.mod/glew.debug.win32.x86.a(glew_static.c.debug.win32.x86.o):glew_static.c:(.text+0xe069): multiple definition of `wglewContextInit'
C:/BlitzMax/mod/bah.mod/cegui.mod/cegui.debug.win32.x86.a(glew.c.debug.win32.x86.o):glew.c:(.text+0xb882): first defined here
C:/BlitzMax/mod/pub.mod/glew.mod/glew.debug.win32.x86.a(glew_static.c.debug.win32.x86.o):glew_static.c:(.text+0xf108): multiple definition of `glewGetErrorString'
C:/BlitzMax/mod/bah.mod/cegui.mod/cegui.debug.win32.x86.a(glew.c.debug.win32.x86.o):glew.c:(.text+0xc689): first defined here


By the way, non-debug build work...
Can you confirm this ??


Armitage 1982(Posted 2009) [#2]
By the way CeGui Layout Editor for 0.7.1 is still not available (if only...).
So I'm stick to the Revision 783 sadly.

If you find a problem I would like to know if I could fix it for that specific Revision.

Thanks !


Brucey(Posted 2009) [#3]
I've patched the latest SVN (BaH.CEGUIOpenGL module) to use Pub.Glew instead of the Glew that comes with CEGUI.

You might do the same with the older version by commenting out the Import of the Glew headers and the glew source.
This is what I have now for the latest :
Import Pub.Glew
Import "../../pub.mod/glew.mod/GL/*.h"
Import "../cegui.mod/cegui/include/RendererModules/OpenGL/*.h"

The first two lines are for the the BlitzMax import, and the third is for access to the CEGUI GL headers.

Hmm. Now that we have native dx9 support, I suppose I should consider looking into adding that dx9 renderer module for CEGUI.


Armitage 1982(Posted 2009) [#4]
Thanks

I try this :
' ogl renderer
'Import "cegui/RendererModules/*.h"
'Import "cegui/RendererModules/OpenGLGUIRenderer/GLEW/*.h"
'Import "cegui/RendererModules/OpenGLGUIRenderer/GLEW/src/glew.c"

Import Pub.Glew
Import "../../pub.mod/glew.mod/GL/*.h"
Import "cegui/RendererModules/OpenGLGUIRenderer/openglrenderer.cpp"
Import "cegui/RendererModules/OpenGLGUIRenderer/opengltexture.cpp"


But
In file included from C:/BlitzMax/mod/bah.mod/cegui.mod/glue.cpp:23:
C:/BlitzMax/mod/bah.mod/cegui.mod/glue.h:25:46: OpenGLGUIRenderer/openglrenderer.h: No such file or directory
C:/BlitzMax/mod/bah.mod/cegui.mod/glue.cpp: In function `CEGUI::Renderer* bmx_cegui_new_oglrenderer()':
C:/BlitzMax/mod/bah.mod/cegui.mod/glue.cpp:447: error: `CEGUI::OpenGLRenderer' has not been declared
Build Error: failed to compile C:/BlitzMax/mod/bah.mod/cegui.mod/glue.cpp


There is no RendererModules/OpenGL in that version of CeGUI.
Do I need to download the BaH.CEGUIOpenGL and try something with it ??

I also try every last version BlitzMax 1.35 + SVN CeGUI 0.7.1, rebuild twice the module (again) but fail while building the modules each time.

I think I will stick to BlitzMax 1.34 and cegui 0.6.3 until the LayoutEditor for 0.7.1 is out.

...Still working on QT ? :D :D


Brucey(Posted 2009) [#5]
This is from revision 405 :
' ogl renderer
Import "cegui/RendererModules/*.h"
Import "cegui/RendererModules/OpenGLGUIRenderer/GLEW/*.h"
Import "cegui/RendererModules/OpenGLGUIRenderer/GLEW/src/glew.c"

Keep the first line, throw away the others, so that it looks like this :
Import Pub.Glew
Import "../../pub.mod/glew.mod/GL/*.h"
Import "cegui/RendererModules/*.h"


I think that's right.

...Still working on QT ? :D :D

Slowly. There's lots of it.


Imphenzia(Posted 2009) [#6]
I'm a bit unsure how to get CEGui (any version) to work - I'm running BlitzMax 1.35 and I get graphical or "program not responding" issues with the examples and code from the current SVN version. I'd preferrably like to use a CEGui that has a working editor with it so I'm assuming that's still version 0.6.2?

Would it be possible to recap the steps necessary to use CEGui in a stable manner for 1.35?


Armitage 1982(Posted 2009) [#7]
Personally I stick to the CeGUI 0.6.3 version (Subversion 783 in CeGUI SVN Module) because there isn't any CeGUI 0.7.1 Layout Editor (no news about it either).
I'm also using the BlitzMax 1.34 although I still need to try the fix to 1.35 provided by Brucey.

That's a lot of versioning and confusion I must admit.
But even if Crazy Eddy is announcing a faster rendering for CeGUI 0.7.1 I didn't see any change in my FPS.

Be aware that some changes can disrupt your layout from CeGUI 0.6.3 to CeGUI 0.7.1
http://www.cegui.org.uk/phpBB2/viewtopic.php?f=10&t=4378&p=20398
Not easy to fix and add more window without a compatible Layout Editor.

No use for the BlitzMax 1.35 since I'm using OpenGL I will wait some updates for the Projection Matrix before using it.


Armitage 1982(Posted 2009) [#8]
I have a few news for the CeGUI Layout Editor 0.7.1 :
Hi,

I'm not certain as to progress on this, scriptkid would need to confirm where we are at. I know what changes are required, and on the surface these are relatively small. Some issues will surely remain in the first attempt (say for example, perhaps not being able to see any rotation you set).

The issue we have as a project is that we could issue a version quickly, though then we get lots of people nagging about issues - so it's sometimes difficult to get the right balance between speed of releases and 'correctness'.

CE.


Seeing difficulties by upgrading to Max 1.36, CeGUI 0.7.1 and maybe soon Box2D 2.1, I feel a little stuck currently.
There is potentially features I could benefit from these new releases but the amount of work to fix everything is awful.
I put my project on hold currently.

Did someone having the same kind of difficulties here ?


Brucey(Posted 2009) [#9]
Every time APIs change, it does make things "more interesting" :-p

Remember, that just because there is a new version of something, it doesn't mean that you must use it. Sure, it's nice to move forward, but as you've seen, it can cause you more work just to adjust to the changes that come with it.

But, where I am positioned, with language bindings, I really need to be keep up with the latest-and-greatest - at least with my SVN version - because it's nice to keep things in sync, and up-to-date.

Generally, you should have less work moving to a new version of a module, than I will have moving the module to a new version of a library ;-)


Armitage 1982(Posted 2009) [#10]
Sure of course :)


Armitage 1982(Posted 2009) [#11]
I try BM 1.36 and didn't notice any problem with it.
The layout editor is on the road (yipiiie) so I'm willing to upgrade to CeGUI 0.7.1 but is the Max module 0.7.0 or 0.7.1 ?

Since I need to change my looknfeel as well as every layout I preferably want to be sure I'm working on the correct version (this one still show 0.7.0 in history).
Many bugs were fixed in the current subversion, for example scrollpane are unusable in 0.7.0 due to inner-rect modifications.

Also I see no other choice for the moment than modifiying the glue.cpp to set at line 456 the log file.
For example in my case :
	CEGUI::System * sys =  &CEGUI::System::create(*r, provider,0,0,0,"","data/Meta.log");


Would it be possible to find a work around this please ?
Thanks a lot !


Armitage 1982(Posted 2009) [#12]
From TCEImagesetManager.getImageset() in 0.6.3 to TCEImagesetManager.get() from 0.7.x I spot a bug.
There is a missing _create for the returning function in base.bmx (line 3200)

	Function get:TCEImageset(name:String)
		Return TCEImageset._create(bmx_cegui_imagesetmanager_get(_convertMaxToUTF8(name)))
	End Function


I also spot some errors line 4034:
	Function screenToWindow(window:TCEWindow, x:Float, y:Float, toX:Float Var, toY:Float Var)
		bmx_cegui_coordconverter_screentowindow(window.objectPtr, x, y, Varptr toX, Varptr toY)
	End Function

toX and toY wasn't used by Varptr

For these simple cases I would gladly submit fix but don't know well how to do this with tortoise SVN.
I suppose you need some privilege or subversion work with a validation system ?

I will read documentation on this if that can help you.


Brucey(Posted 2009) [#13]
Yes, I need to update to the latest from CEGUI SVN.

There is a missing _create for the returning function in base.bmx

Actually, the low-level function should be returning a TCEImageset object instead - to match the other changes I've made in the API (for example, with FontManager and SchemeManager). The methods should all work in a similar way. I appear to have missed some though.

toX and toY wasn't used by Varptr

Nice find. Thanks :-)


Brucey(Posted 2009) [#14]
I've updated to the latest now. I hope it helps with some of those issues.


Armitage 1982(Posted 2009) [#15]
As I say in the CeGUI forum : it's working great !
I'm just wondering now why my game is 90FPS slower than 0.6.3

I still need to fix every layouts, but I don't like the last fact...

Thanks a lot Brucey !!


Armitage 1982(Posted 2009) [#16]
I suppose there isn't any new method implemented ?
Because I can't use the new parser system :
http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html

I don't know well if you need to enable this with CEGUI::Window::setTextParsingEnabled() or CEGUI::Window::setCustomRenderedStringParser()
It's probably stuff like parser, the new GeometryBuffer or RenderEffect that slow down the rendering a bit...
Well I suppose.

Maybe I should try the "If It Works, Don't Fix It!" ^^


Brucey(Posted 2009) [#17]
Also I see no other choice for the moment than modifiying the glue.cpp to set at line 456 the log file.

Tut tut :-)
Why would you want to be doing that?

It you have a look at test_01, you'll see "New CustomLogger" near the top of the app.
Towards the bottom, you'll see the type defined, with the logEvent() method implemented.

Note that you must create your logger instance before the call to Init_CEGUI().

:-)


Armitage 1982(Posted 2009) [#18]
Oups !
I don't know why I forgot that one nor why I implement a TCECustomLogger somewhere in a lost part of my framework.
As soon as I'm trying to

New CustomLogger
TCELogger.GetLogger().setLoggingLevel(LOG_ERRORS)
TCELogger.GetLogger().setLogFilename("test.log")

Init_CEGUI()

Type CustomLogger Extends TCECustomLogger

	Method logEvent(message:String, level:Int = LOG_STANDARD)	
		bmx_cegui_logger_logevent(_convertMaxToUTF8(message), level)
		'Super.logEvent(message, level)
	End Method
	
End Type


Whatever I'm trying inside Method logEvent() things crash with a stack overflow.
And if I don't implement any logEvent inside my CustomLogger it crash again :)
Getting the default logger with or without the creation of a custom logger don't work too.

I just want to specify another name and location for the log file but I fail at this...

Also, did you manage to use the new text TAG system at some point ??

Thanks :D


Brucey(Posted 2009) [#19]
Sorry for the confusion.

If you want to use the "default" logger, you need to call the GetLogger() methods after Init_CEGUI() - because the default logger is not created until then.
The reason you need to create a custom logger instance before the call to Init_CEGUI() is to prevent the creation of the default logger... if that makes sense? :-p

so,
Init_CEGUI()

TCELogger.GetLogger().setLoggingLevel(LOG_ERRORS)
TCELogger.GetLogger().setLogFilename("test.log")

..



Brucey(Posted 2009) [#20]
Also, did you manage to use the new text TAG system at some point ??

What TAG system?


Armitage 1982(Posted 2009) [#21]
The reason you need to create a custom logger instance before the call to Init_CEGUI() is to prevent the creation of the default logger... if that makes sense? :-p

I came to that conclusion too (and now I remember why I try the customLogger).
The problem is that Init_CEGUI() create the Logger singleton and immediately log some event to the default "CEGUI.log" file.

Renaming the LogFilename work as expected but leave about fifty log entries in the default CEGUI.log and I don't like that because I now have 2 log file at different places (plus my uninstaller won't completely remove the game folder when uninstalling because of the undeleted runtime created files).

But no big deal, I will continue to modify the module to change the default CEGUIlog file.

What TAG system?


It's mainly why I want to switch to 0.7.x
There is new rules for the current text Parser listed here : http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html
In theory you can add images or change fonts style inside any text by adding Tag like :

.setText("This is my text [colour="FF00FFFF"]coloured in red[/colour] or something")


- Added new string rendering enhancements, current version provides:
- Extensible RenderedStringParser system.
- Base support for parsing formatting tags in strings:
- Support for [font] tag to enable multiple fonts per text string.
- Support for [colour] tag to enable multiple colours per text string.
- Support for [image] tag to enable embedding of images in strings.
- Support for [window] tag to enable aligning child window/widget content in-line with other string rendering.


Probably there is new missing methods like CEGUI::Window::setTextParsingEnabled() to enable this ?

I want to have a look to that feature before switching to 0.7.x because that version is slower than 0.6.3 unfortunately.
None of the examples provided by CE seam's to use that new feature.


Brucey(Posted 2009) [#22]
None of the examples provided by CE seam's to use that new feature.

Possibly why I've not noticed it yet :-)

But no big deal, I will continue to modify the module to change the default CEGUIlog file.

You can always do this ...
Type CustomLogger Extends TCECustomLogger

	Field stream:TStream

	' does nothing - we are outputting to the debuglog
	Method setLogFilename(filename:String, append:Int = False)
		If stream Then
			CloseStream(stream)
		End If
		
		stream = WriteStream(filename)
	End Method

	' called for *every* event
	Method logEvent(message:String, level:Int = LOG_STANDARD)
		If stream Then
			stream.WriteLine("EVENT : " + message)
		End If
	End Method

End Type


And use something like this :
New CustomLogger
TCELogger.GetLogger().setLogFilename("test2.log")


:-)


Armitage 1982(Posted 2009) [#23]
Yes that's a clean solution but since I'm always using the same folder architecture in my software it's not really a problem to modify this in the source.

Possibly why I've not noticed it yet :-)


Probably !
I'm having some difficulties to spot what's really new and useful in this new release except for the new parser.
There is also a word about the support for three axis rotation here : http://www.cegui.org.uk/phpBB2/viewtopic.php?f=6&t=4340
But I really don't see the point of that feature.


Armitage 1982(Posted 2009) [#24]
I read that you need to add
<Property name="AutoRenderingSurface" value="True" />

to your xml looknfeel file in order to activate the performance boost and effects capabilities.
http://www.cegui.org.uk/docs/current/classCEGUI_1_1WindowProperties_1_1AutoRenderingSurface.html

But no effects and WORST : it even slower than before (from 330 fps to 220fps).

I think I'd rather have a solid version of 0.6.3.
I see you add some fix lately. Does those fix are really important ?


Armitage 1982(Posted 2009) [#25]
CrazyEddie add an important fix for AutoRenderingSurface alpha problem in the last CEGUI SVN.
I don't know if this would resolve the slow down.

Would it be possible that the new opengl renderer module in last version of CEGUI is responsible for such slow down ?


Brucey(Posted 2009) [#26]
I've updated to the latest code.
Give it a try, and see if it helps any.


Armitage 1982(Posted 2009) [#27]
Thanks

The rendering is better but there is still some alpha on text and some windowFrame is still too transparent.
About the speed now, it's still slower :(
False alarm...


Armitage 1982(Posted 2010) [#28]
I have updated to the last version svn and while I'm currently converting my looknfeel thanks to the new CELayoutEditor 0.7.1 (yupiii) I still get alpha transparencies on text within multiple line editbox and wrong level of alpha when you set any window alpha !?

Is there any new SVN ?

Also I still encounter the same slow down with the current version of ceguiopengl driver :(
CE suppose there is some conflictual situation with opengl that slow down the rendering...


Armitage 1982(Posted 2010) [#29]
Some of the Window base method are missing too :)
Like setTextParsingEnabled()


Brucey(Posted 2010) [#30]
Is there any new SVN ?

I'm not sure. Possibly. I've lately been working on some code-generation techniques in order to lessen my workload when it comes to initially setting up certain wrappers, and this has absorbed a lot of my time recently.

Some of the Window base method are missing too

I don't doubt that for a moment. Have you seen how many there are? :-p


Armitage 1982(Posted 2010) [#31]
Words from Cegui :
The analysis as far as the performance issue goes currently remains the same; something is short-circuiting the caching facilities within CEGUI causing the performance hit. I need somebody to provide some kind of test code that demonstrates the issue before I can change this conclusion (or in other words, I have not been able to reproduce the results - the results I've had have been reasonably comparable to the native C++ code, with no slow down / hits).


Now the slow down is about 100 Fps (315 Fps in 0.6.2 and 215 Fps in 0.7.1)...


Armitage 1982(Posted 2010) [#32]
I don't doubt that for a moment. Have you seen how many there are? :-p


Indeed !
There is a few stuff in there...

I suppose the new enableExtraStateSettings() function inside CEGUIOpenGLRenderer.h shall be accessible somewhere although I have no idea what GL state that function change.