Can i draw in CEGUI ?

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

maitvn
Just popping in
Just popping in
Posts: 8
Joined: Fri Aug 01, 2008 03:54
Location: Sun system

Can i draw in CEGUI ?

Postby maitvn » Wed Aug 06, 2008 09:38

I want to draw a simple graph with CEGUI , Can i draw it ? how to ?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Aug 07, 2008 09:19

CEGUI has no drawing functions as such.

You could draw to a texture that you subsequently use as the basis of an Imageset and use a widget (StaticImage maybe) to output the content.

CE.

maitvn
Just popping in
Just popping in
Posts: 8
Joined: Fri Aug 01, 2008 03:54
Location: Sun system

Postby maitvn » Fri Aug 08, 2008 02:40

Thank you verymuch !

And i have two Problems :

* I want to load a clock image , this problem can solve by use imageset .

* I want to create a needle of clock can move around Origin . Now , i have no idea for This problem . Can you help me ??

thanks again !
Last edited by maitvn on Mon Aug 11, 2008 03:48, edited 1 time in total.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Aug 08, 2008 12:04

Basically you'll use some other drawing library, or maybe the graphics API directly to perhaps draw a line or polygon into a texture.

You then use that texture as the basis for another Imageset, define an Image for the area that you drew into, and use this Imageset / Image combo as normal. One thing to consider about this is that you only need to do the Imageset creation part once - you can update the content of the underlying texture as you require and the updated content will show next time CEGUI redraws.

Note that in regard to creating the Imageset from the texture, you usually would create a CEGUI::Texture from the underlying engine / API texture for use by the Imageset, however if you're using OpenGL, we are missing a means of doing this directly, so you'd create the CEGUI::Texture first, extract the OpenGL texture name from this and then either the data into it (or use it when setting up a frame buffer, or whatever).

CE.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests