Drawing functions

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

Tennax
Just popping in
Just popping in
Posts: 4
Joined: Sat Oct 21, 2017 20:02

Drawing functions

Postby Tennax » Sat Oct 21, 2017 20:21

Hello,
I'm new, only started learning this system and I have few questions
Mostly I using DirectX 9 and functional I'm asking about available using it
Can I use CEGUI rendering system to draw:
1) Primitives (rectangle, circle, triangle and etc.)? (DrawPrimitiveUP)
2) Pictures (with rotation, scalling, color modulation)? (ID3DXSprite)
3) Text (with shadow/border, size calculation)? (ID3DXFont)
Can I draw in different modes:
1) Immediate mode, draw at the moment I called the function, when I working at the main thread?

Code: Select all

example:
renderer.drawTriangleFill(x1, y1, x2, y2, x3, y3, color1, color2, color3);
renderer.drawRectangleContour(x, y, w, h, thickness, color);
...

2) Listing mode, collect commands I need to render at one thread and draw it in main thread?

Code: Select all

example:
RenderList list;
list.pushRectangleFill(x, y, w, h, colorlt, colortr, colorbr, colorlb);
list.pushPicture(texture, x, y, scalex, scaley, rot);
...
renderer.drawList(list);

I have this functional partially only in DirectX 9, but maybe this engine can do it universally?
Is it possible in this engine and if it is how to use it right?
Thank you
P.S. English not my native language, so I'm sorry if I'm not correct

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

Re: Drawing functions

Postby Ident » Sat Oct 21, 2017 20:54

This is not a graphics engine.

You can do 2 and 3 as well with it, not sure if we call exactly the things you said in our D3D9 Renderer though. You can do 1 but if you want to do more advanced stuff than just drawing colored & textured triangles you will be out of luck, we dont support custom shaders in 0.8.X.

Again, it is not a graphics engine. It is a UI toolkit and I would advise against (ab)using it as an engine.
CrazyEddie: "I don't like GUIs"

Tennax
Just popping in
Just popping in
Posts: 4
Joined: Sat Oct 21, 2017 20:02

Re: Drawing functions

Postby Tennax » Sat Oct 21, 2017 21:19

Thank you for reply
I understand that it's not graphics engine, but thing is that I need GUI + some basic graphics
No, no, I'm not about complex things like custom shaders and other stuff
I will list everything what I would like, and if it does not make it difficult for you to answer, please write what possible
1) Lines - good if every vertex can have own color, good if support any thickness, and if possible antialiasing
2) Triangles - good if every vertex can have own color
3) Rectangle - good if every vertex can have own color with alpha channel support, and if possible rounded corners (not important)
4) Circles - not important and I think it will work too slow, because need more vertices?
5) Images - good if have scalling, rotation and color modulation
6) Texts - with v/h alignment and if possible bounding, i think shadows and borders can be only faked?
P.S. I planning to use CEGUI 0.8.7 only on DirectX 9,10,11

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

Re: Drawing functions

Postby Ident » Sat Oct 21, 2017 21:29

Take a look at the sample browser and play around with the widgets using the CEED Editor. Also look at the code and the API and you will know if this library fits your needs.
CrazyEddie: "I don't like GUIs"

Tennax
Just popping in
Just popping in
Posts: 4
Joined: Sat Oct 21, 2017 20:02

Re: Drawing functions

Postby Tennax » Sun Oct 22, 2017 08:47

Okay, so I should use CEGUI::GeometryBuffer?
Should I cleanup it every frame before adding new geometry, because overlay I doing must be updated every frame?

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

Re: Drawing functions

Postby Ident » Sun Oct 22, 2017 08:48

Just use the GeometryBuffer API and you should be fine:
http://static.cegui.org.uk/docs/0.8.0/c ... uffer.html

If you got different vertices you will need to clean them up every frame yes. For efficiency's sake you would want to change as little as possible.
CrazyEddie: "I don't like GUIs"

Tennax
Just popping in
Just popping in
Posts: 4
Joined: Sat Oct 21, 2017 20:02

Re: Drawing functions

Postby Tennax » Sun Oct 22, 2017 09:32

But I still can't draw lines, right?

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

Re: Drawing functions

Postby Ident » Sun Oct 22, 2017 10:54

In 0.8 you can draw lines in the form of a long quad composed of two triangles, which is one way to render a line in any modern rendering engine as welö.

In CEGUI 1.0 there is the possibility to draw lines by specifying start & end points, which is probably what you want. But 1.0 is in development so this is rather experimental and we only provide a D3D11 renderer there (which works with D3D9 hardware).
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 1 guest