Main Site Documentation

Another Graphics Library


#1

Hi all.
First of all I’d like to tell some words about how it began.
Also I want to apologize for my English as I’m a native Russian speaking person. And also I’d like to apologize before people participated in previous discussions if I caused offence to anybody.

I’m developing my own project which is to be taken into production in the future. This project concerns the remote control of groups of robots. Besides controlling from cell phones (Android and Windows Phone) it will be possible to control them from central unit with touch screen display. The central unit was decided to be a Cobra with 7" display. So I stumbled upon the need to get some graphics library to use in development. The choice wasn’t wide though: Glide, Gadgetos, .Net Clix, some other libs, and developing own library. So I began trying and testing these products. To save my time on development the GUI library I was even ready to buy the Glide with the license for commercial use for 1000$ that was its price not much time ago.
Test results became far enough from satisfying for me. So I started a few threads in “Glide — Graphical library for NETMF” branch of the forum. You can see them here:

http://www.tinyclr.com/forum/22/5051/
http://www.tinyclr.com/forum/22/5053/
http://www.tinyclr.com/forum/22/5188/

Also I took my own GUI library written for MS XNA games some years ago and tried to adapt a part of it to netmf. I posted some results of it on youtube:

So, based on these results, I decided to try to develop my own graphics library. In this thread I’d like to post the results of this process and would appreciate any comments and judgements. I invite everyone interested to participate.
Also the only time I have for this lib development is my nights so I’ll move on at my own pace.
I don’t know right now what will be the result of this work but I think I could give it a try.


#2

For now I’m concentrated at development of rendering core (engine) and user controls. Now engine is capable of moving window with dynamically changing content. I’m still fighting for every milliseconds to improve the performance as much as possible.


#3

Wiki would be a good place for these posts


#4

Architect, I’m not sure about it. I can explain the reason. If this project will become successful it would be a case to license it somehow. So now I’d like not to share the source code and details. The future will show, will see :). And now just features and achievements for this time.


#5

you can still use a wiki or blog to document your process and evolution. You’ve got yourself another monologue thread going here :slight_smile:


#6

I hope it won’t be a monologue 'cause I look forward for all your propositions, judgements and discussions.


#7

Use wiki for the project. Put link on wiki to the thread for feedback.


#8

Please could you point me how to start a blog there? And in which category? I’m upset a little ::slight_smile:


#9

oh, I see, Techology->Touch screen :slight_smile:


#10

It seems I have some troubles with permissions. Also I need to get familiar with wiki rules as well.
It’s a very deep night here so I need to have some sleeping (I’m +7 hours from site time).
See you tomorrow, guys!
And thank you.
:slight_smile:


#11

If you plan on going commercial just make sure you don’t borrow too much from any of the other GUIs you’ve looked at; they all have at least Apache 2 licenses so you’d be required to give out source.

Can’t wait to see what you come up with; it’s always nice to have more options out there and I think all these projects help inspire everyone to make improvements/additons.


#12

Some new results on youtube

It still needs some more optimization to be faster. But you can see that along with the window movement its clock label, status bar and level update all together.


#13

Why do you need the window to be movable? This is something that defiantly wasn’t planed for glide to have. Glide is for commercial user who needs user interface. Think of a treadmill at you GYM. You need some buttons to change the speed or radio station, maybe “slide” from one window to another, but you will never ever need to move a window like you do in your video or like you would do on a windows PC.

If that is what you need, then Glide is surly not the right tool.

Another thing is what is the “embedded” system is capable of. We spent long month optimizing things as much as we can while still keeping glide useful. For example, you got the window to move but you can see how slow it is? This is fine for fun but if we present this to a commercial customer they will probably go back to using android :slight_smile:

What I am trying to say is, keep on developing a library and we look forward to seeing it done. Very soon you will realize that theoretical assumptions are way far different from reality. Perhaps keep track of how many hours you are putting into it as well.


#14

Gus, I realize almost all you said is correct.
With dynamic window I just check achievements in performance. Also this can be useful implementing sliding virtual keyboards etc. But the main benefit is that with this approach I can render dynamic text content much faster. It doesn’t matter for the engine weather the window is moving or labels change their text. Please remember those labels with system clock continuously updating. I keep them in mind. And I also keep in mind even worse case with netmf wpf when with only the single clock label all the ui is dead.
I do my development not to get flying windows :slight_smile: , it’s impossible, but to get the better and the best from rendering. I think it would be very good even if we could get a couple times faster performance.
Thus all what I’m doing now is to get the max available from hardware. :slight_smile:


#15

I still have a couple of optimizations to try to apply. After that when I’ll be completely sure it’s no way to get better I’ll continue with set of controls.

I just wonder what if to try it on more powerful hardware like ChipworkX or Hydra. For sorry I don’t have this possibility. But I could share a hex for you to try. It’s very interesting!


#16

And don’t forget that I also need the dynamic content for my own project, it’s just necessary, so I must get the best from hardware :slight_smile:


#17

So I finished my render core for 99%.

For test I used static window with 20 labels displaying system time ticks as soon as possible. Here is the source code for Glide (for my lib the code is similar):


    public class Program
    {
        static Window window;
        static DateTime dt0;
        static TimeSpan ts;
 
        public static void Main()
        {
            string xml;
            xml = "<Glide Version=\"" + Glide.Version + "\">";
            xml += "<Window Name=\"window\" Width=\"250\" Height=\"400\" BackColor=\"eeeeee\">";
            xml += "</Window>";
            xml += "</Glide>";
 
            Glide.FitToScreen = false;
 
            window = GlideLoader.LoadWindow(xml);
            
            for (int i = 0; i < 20; i++)
                window.AddChild(new TextBlock("", 255, 0, 20 * i, 250, 20));

            Glide.MainWindow = window;

            new Thread(delegate()
            {
                while (true)
                {
                    dt0 = DateTime.Now;

                    DateTime dt = DateTime.Now;
                    for (int j = 0; j < window.NumChildren; j++)
                    {
                        TextBlock lbl = (TextBlock)window[j];
                        lbl.Text = dt.Ticks.ToString();
                        window.FillRect(lbl.Rect);
                        lbl.Invalidate();
                    }

                    ts = DateTime.Now - dt0;
                    Debug.Print("Glide: " + ts.ToString());
                }
            }
            ).Start();

            Thread.Sleep(-1);
        }
    }

I ran both test applications in emulators simultaneously. Here are debug prints:

Glide: 00:00:00.7030800
MFE: 00:00:00.4716495
MFE: 00:00:00.4530960
Glide: 00:00:00.7772940
MFE: 00:00:00.4599315
Glide: 00:00:00.7587405
MFE: 00:00:00.4687200
MFE: 00:00:00.4599315
Glide: 00:00:00.7714350
MFE: 00:00:00.4570020
MFE: 00:00:00.4560255
Glide: 00:00:00.6894090
MFE: 00:00:00.4696965
Glide: 00:00:00.7411635
MFE: 00:00:00.4687200
MFE: 00:00:00.4667670
Glide: 00:00:00.7138215
MFE: 00:00:00.4540725
Glide: 00:00:00.7763175
MFE: 00:00:00.4599315
MFE: 00:00:00.4550490

So my render engine seems to be twice faster than Glide’s.
Also consider that my engine is still capable to dynamically move any controls with repainting previously occupied areas and displaying dynamic content inside parent dynamic content.

I made the video as well. I’ll post it on youtube a bit later.


#18

Some UI controls demo so far (window, checkbox, level, panel, button, toolbutton, label, radiobutton, radiobuttongroup, image)


#19

Looking good! Video?


#20

I use Winks for capturing video from screen in swf format. And youtube doesn’t accept some of them sometimes for some reason. So it happened last time. I’ll try to recapture video from emulator and from live device a bit later when I get home.