GUI Theory

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
jammmie999
Posts: 13
Joined: Sun Feb 06, 2011 4:54 am

GUI Theory

Post 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
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: GUI Theory

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
chibicitiberiu
Member
Member
Posts: 68
Joined: Thu May 28, 2009 11:46 pm

Re: GUI Theory

Post 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
Tibi,
Currently working on the Lux Operating System
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: GUI Theory

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
jammmie999
Posts: 13
Joined: Sun Feb 06, 2011 4:54 am

Re: GUI Theory

Post by jammmie999 »

Thanks for the feedback, can anyone reccomend any links for further research except search engens and wiki?

Thanks again
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: GUI Theory

Post by Combuster »

Learn to read?
DirectX 7/SDL (for 2D) and DirectX8+/OpenGL (3D)
www.brackeen.com/vga
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: GUI Theory

Post 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
Last edited by Ready4Dis on Thu Sep 08, 2011 8:07 am, edited 1 time in total.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: GUI Theory

Post by Brynet-Inc »

Paragraphs. Use them.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply