[SOLVED] Updateing text on rotated label does not work

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

komarx6
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Oct 31, 2014 16:53

[SOLVED] Updateing text on rotated label does not work

Postby komarx6 » Thu Sep 10, 2015 11:42

Hello.

I'm playing with CEGUI a little bit.
I'm using OpenGL renderer, and I set rotation to some label. It works OK, but when I set different text to that label it gets drawn on top of previous text.
I tried calling invalidate(true) on that label but it does not work.

I've been looking for solution for quite long, but I could find it.
Should I report a bug or there is simple workaround?

Thanks
Last edited by komarx6 on Tue Sep 15, 2015 11:37, edited 1 time in total.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Updateing text on rotated label does not work

Postby Ident » Thu Sep 10, 2015 13:52

Screenshot please
CrazyEddie: "I don't like GUIs"

komarx6
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Oct 31, 2014 16:53

Re: Updateing text on rotated label does not work

Postby komarx6 » Thu Sep 10, 2015 14:16

ForCEGUIGuys.png
ForCEGUIGuys.png (11.72 KiB) Viewed 9932 times


here you go.
Lable has initial text "V", then I programmatically set anothors string, and than another. But old text is still
partially visible below new one.

Any thoughts?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Updateing text on rotated label does not work

Postby Ident » Thu Sep 10, 2015 14:22

Do you ever clear your framebuffer?
CrazyEddie: "I don't like GUIs"

komarx6
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Oct 31, 2014 16:53

Re: Updateing text on rotated label does not work

Postby komarx6 » Thu Sep 10, 2015 14:25

No, at least I don't know about that. I'm not really CEGUI expert, and I'm not expert in graphics neither.

How do I do that?

Is is costly? Any performance issues?

Thank you for quick reply.

komarx6
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Oct 31, 2014 16:53

Re: Updateing text on rotated label does not work

Postby komarx6 » Thu Sep 10, 2015 14:33

OpenGL's framebuffer? Shouldn't that be done automatically? I don't know how to use OpenGL, I was hoping that I could use pure CEGUI without digging down to it's specific implementations. But you could point me to class, function or something like that, that I should call form specific class/function.

komarx6
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Oct 31, 2014 16:53

Re: Updateing text on rotated label does not work

Postby komarx6 » Thu Sep 10, 2015 14:35

If I wasn't clear enough, it only happens when I set rotation to label, when it starts using RenderingWindow as it's rendering surface.

komarx6
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Oct 31, 2014 16:53

Re: Updateing text on rotated label does not work

Postby komarx6 » Thu Sep 10, 2015 14:48

OK, I do call glClear in beginRendering function. If that is what you meant, then that is not problem.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Updateing text on rotated label does not work

Postby Ident » Thu Sep 10, 2015 14:53

The only thing you need to for CEGUI to render with OpenGL, in case you do not render anything yourself, is to call glClear() each time before rendering CEGUI in your loop, and calling swapbuffer after rendering CEGUI. Look at the application templates for example linked from our homepage.

Edited.
CrazyEddie: "I don't like GUIs"

komarx6
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Oct 31, 2014 16:53

Re: Updateing text on rotated label does not work

Postby komarx6 » Thu Sep 10, 2015 14:56

I already done that. I put glClear in beingRendering, and glSwapBuffers in endRendering. And as I said, not only happens with rotated label, when it uses RenderingWindow. When I set rotation it calls allocateRenderingWindow and draw to some TextureTarget. And it seams that that causes problems. Without rotation and RenderingWindow, it works fine.

I've been digging a lot into CEGUI to find where is the problem, but I don't really understand low level things like openGL calls, only basic stuff.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Updateing text on rotated label does not work

Postby Ident » Thu Sep 10, 2015 16:23

Can you reproduce it in the SampleBrowser? Just edit the HelloWorld example and run the SampleBrowser and tell me if you can rotate and edit texts there without issues. If you can, then we know the issue is not in CEGUI but in the way you use it and we may proceed from there with helping you find a solution.
CrazyEddie: "I don't like GUIs"

komarx6
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Oct 31, 2014 16:53

Re: Updateing text on rotated label does not work

Postby komarx6 » Thu Sep 10, 2015 16:27

OK, I'll try it.

komarx6
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Oct 31, 2014 16:53

Re: Updateing text on rotated label does not work

Postby komarx6 » Thu Sep 10, 2015 19:29

Yes, it was my mistake. Sorry for being stupid and taking your time.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Updateing text on rotated label does not work

Postby Ident » Thu Sep 10, 2015 19:32

Edit the original post title to prepend [Solved] and describe what was wrong and how you solved it please.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 6 guests