Page 1 of 1

GUI Theory

Posted: Fri Sep 02, 2011 6:53 pm
by jammmie999
Hey can you rate this theory for GUI design
An array of arrays that theoretically repesesnt a 2D grid. Each Array-Array-Int contains a color RGB for that pixel on screen. Then wipe the screen and output the color pixels of this array on screen, repeat about 10x1 second.
It could then be expanded to Array-Array-Array-Int for 3D display/3D gameing?

How does this compair to other GUI styles and what other GUI styles are there? I just thought of this my self, havent researched properly yet. And how performance taxing do you think this would be,
e.g. would have to update lots of ints to move a window = very slow?

Thanks

Re: GUI Theory

Posted: Fri Sep 02, 2011 9:10 pm
by Love4Boobies
jammmie999 wrote:Each Array-Array-Int contains a color RGB for that pixel on screen.
Not sure where you came up with that "Int" from. Either way, specifically settling on RGB is kind of silly; consider devices that natively use indexed colors or different color spaces such as CIE XZY. Your GUI should either have some sort of abstraction or use a broader color space.
jammmie999 wrote:Then wipe the screen and output the color pixels of this array on screen, repeat about 10x1 second.
That sounds terrible.
  • Why would you wipe the screen before drawing to it instead of overriding pixels?
  • Where did the 10 FPS thing come from?
When an area needs to be refreshed, refresh only that area and that's it.
jammmie999 wrote:It could then be expanded to Array-Array-Array-Int for 3D display/3D gameing?
No, that sounds like a terrible voxel-based engine.

I didn't bother answering the rest. I suggest that you write some applications in user space to get more familiar with the programmer mindset before you start considering studying OSes. It will help you a great deal.

Re: GUI Theory

Posted: Sat Sep 03, 2011 3:17 am
by chibicitiberiu
An array of arrays that theoretically repesesnt a 2D grid
Aka a matrix.
Then wipe the screen and output the color pixels of this array on screen, repeat about 10x1 second.
No way, you don't want to do that. A good FPS value would be 60, not 10. And you DON'T want to write the whole screen every time, just the portion that was modified.
It could then be expanded to Array-Array-Array-Int for 3D display/3D gameing?
For 2D, a RGB matrix is okay.

For 3D it is impossible, that would take enormous amounts of space, and it is very impractical. For example, to draw a cube that's 500x500x500px in size, you would use about 500MB of memory (500 * 500 * 500 * 4, where 4 is the size of an ARGB pixel). Also, you didn't take perspective into account, the second plane would need more pixels to fill the screen. What game have you ever seen to have a 'cube' model that uses 500 MB of disk space?

Drawing 3D objects is done through polygons, not pixels.

How does this compair to other GUI styles and what other GUI styles are there? I just thought of this my self, havent researched properly yet. And how performance taxing do you think this would be,
e.g. would have to update lots of ints to move a window = very slow?
Memory access is pretty fast, but writing to hardware is awfully slow.
That is why existing GUIs use double (even triple) buffering. And only draw an area if it was modified. There is a VGA tutorial which shows how to create some basic graphics: www.brackeen.com/vga

Re: GUI Theory

Posted: Sat Sep 03, 2011 3:44 am
by Combuster
havent researched properly yet
That behaviour will not bring any goodwill at your address. Actually, it's one of the most frequent cause of bans here.

Have you tried any development with DirectX 7/SDL (for 2D) and DirectX8+/OpenGL (3D), because it seems quite likely that you haven't. Knowing how things work from the user side will provide insights in how to make things work from the OS side.

Re: GUI Theory

Posted: Sat Sep 03, 2011 4:41 am
by jammmie999
Thanks for the feedback, can anyone reccomend any links for further research except search engens and wiki?

Thanks again

Re: GUI Theory

Posted: Sat Sep 03, 2011 5:12 am
by Combuster
Learn to read?
DirectX 7/SDL (for 2D) and DirectX8+/OpenGL (3D)
www.brackeen.com/vga

Re: GUI Theory

Posted: Tue Sep 06, 2011 9:45 am
by Ready4Dis
I'm not sure the OP is even asking the right questions. Firstly, a GUI is a method of displaying information to a user. You are talking about rasterizing, which is a method for putting color information to a display. A gui is more like, a window + buttons, or a menu system, with a method of getting user inputs (aka, mouse, keyboard, kinect, w/e you want to use). Yes, a screen can be thought of a 2d array of pixels, however it's typically a 1D array in practice (aka, contigous memory). Please clarify the question, because from what you've written, it doesn't make a lot of sense.

Also, 3D displays typically just display 2 2D images, with the pixels offset based on the Z axis. It's how our eyes function, each eye see's a slightly different view and our brain merges the two images to get depth information.

3D tech. reproduces this by generating two vantage points (aka, you're eyes), and setting a focal point (aka, what you're looking at) and renders both images. These images get to your eye's by different methods depending on the method used.

The most common methods, anaglyphic - red/blue glasses, each lense filters out the colors from the other, allowing each eye to see it's own pictures. Bad side is colors are washed out.

There is the typical method for PC's which use active shutters, in which it opens/closes a shutter on each eye at a specific rate so each eye only see's the picture that is intended for it. Bad parts are, you lose about 1/2 brightness, and it can cause headaches for lots of people, and requires high refresh rates, extra hardware, and typically glasses are bulky and require batteries.

Third is polarized lenses. There are two sets of lense, one horizontally polarized (left/right), and another vertical (up/down). By projecting two seperate pictures, opposite poloraized, and wearing polarized glasses, each eye can only see one image. Downside is, if you tilt your head the two images get blurred (because you're no longer vertical/horizontal).

The fix was to use circularly polarized lenses, one is polarized clockwise, the other counterclockwise. This allows you to be able to view it from any angle and still see the correct image. Downsides, costs more, typically only used with projectors (since you can literally put the lenses in front of each projector). Upside is you get 100% brightness, minimize chance of headaches, glasses are much lighter and cheaper (almost throw away at your local movie theatre).

There are other technologies that are in use, like the no glasses nintendo 3ds (and the new android based 3d phone) which use a slightly different method, think of the screen as small waves, instead of flat. If you look at the screen from one direction, you see one side of the wave, if you look from the other, you see the other side. So, for small devices with a pretty established distance from viewer, they can send a specific picture to each eye.

Ok, this turned from a gui vs. rasterize explanation to an entire 3d primer, but hey :)

* Edit *
Added paragraphs as requested below

Re: GUI Theory

Posted: Wed Sep 07, 2011 3:57 pm
by Brynet-Inc
Paragraphs. Use them.