migueltk's picture

GUI GWEN.NET Another small but great project

Today, thanks to StrongCod3r have known of this project Gwen.net is a GUI for OpenGL-OpenTK simply fantastic!.

Do not hesitate, download the source and use in your projects.

Miguel


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Snorkel's picture

This looks very interesting thanks for sharing!

flopoloco's picture

Great work miguel as usual! Keep it up. Thanks for the share.

migueltk's picture

I've been playing around with the colors of the skin and I got this other darker skin. Obscure-Skin link.

I love Gwen, I only find one problem, it is very slow. On my computer the frame rate per second (FPS) for Gwen is about 240 and for Bixion2D is about 1000, the difference is remarkable.
On the project page Gwen.net I added an entry in the "issues" that solves the resizing.

Snorkel's picture

Are you guys using the latest version from SVN ?

When I run the OpenTK unit-test sample the 'Unit tests' panel on the left is empty. I can click the buttons that are supposed to be in there.
Everything else seems to work. I can't seem to figure out why it's not rendering the elements inside the 'Unit tests' panel.

Anyone having the same problem or am I experiencing a driver issue?

c2woody's picture

Assure that the image resources (like DefaultSkin.png) are in the binary folder, either by copying them there or by changing the "Copy to Output" property in the respective sample project.

[edit:] You might need to grab the DefaultSkin.png from the gwen subversion repository, the one in the GWEN.NET seems outdated.

Snorkel's picture

Ok thanks
works now!

The DefaultSkin.png from the 'Gwen.Sample.OpenTK' directory was causing the problems.
The one from the 'media' folder works fine.
Only difference in the textures seems to be the colour swatches at the bottom.

Snorkel's picture

@migueltk
The performance problems seems to be related to calling GL.Flush().
It's called way to much. I think with some care you don't need any at all.

migueltk's picture

Yes, I also think the problem is so many calls to GL.Flush (). The code needs revision.

c2woody's picture

Do the text functions work fine for anybody? For example the TextBox test (editable text) is quite off for the text selection here, or the button spacing (StatusBar test) looks wrong.

Snorkel's picture

@c2woody
The text renders fine, but the cursor placement and selection is indeed wrong.

@migueltk
I managed to make it run faster
as reference the C++ DX9 example runs at ~500 fps ( OpenGL sample was locked at 60 fps )
and now the C# OpenTK sample runs at ~1000 fps similar to the C++ SFML sample.

I did the following:
* Removed all the GL.Flush calls and use one big array of vertices
* Only call draw when swapping textures
* Removed scissor test and replaced it with software scissor test, so it never has to change renderstates
* Removed GL.GetBoolean and GL.GetInteger and just stored the values in C#
* Changed primitive type from triangles to quads
* Removed Z component of the vertices

I think the slowest thing left atm would be the number of texture changes used to render al the text.

Didn't look at the CPU usage yet, so might run even faster with some more work :-)

Also I'm not sure about the way GL.DrawArray is used, would it be faster to use a VBO ?