Anyone have ideas on implementing a GUI?
Anyone have ideas on implementing a GUI?
Hello again:
I was wondering how some of you went about making a GUI. Did you create your own graphical primitives, or get a VESA standard library working on your OS? I have initialized a VESA window, and would like to know what some of you all did.
Also, like for the graphics, like an X for close, did you make up your own format, or use something like .BMP or .PCX?
Thanks,
David
I was wondering how some of you went about making a GUI. Did you create your own graphical primitives, or get a VESA standard library working on your OS? I have initialized a VESA window, and would like to know what some of you all did.
Also, like for the graphics, like an X for close, did you make up your own format, or use something like .BMP or .PCX?
Thanks,
David
President of the Useless OS project
Re: Anyone have ideas on implementing a GUI?
Hello,
In my system the GUI will run in userspace and will render graphics using a video-independent API [which contains primitive routines] which in turn calls the current video driver. This allows multiple video drivers and graphics mode independent from the GUI, managed by the software Subsystem API called from a userspace program.
ie, like: program->SubSystem API->Video-independent API-> [...] ->Video driver
While it is planned to provide support for both VBE and generic video drivers, we currently only have a protected mode VGA driver.
Please keep in mind that this setup is just design.
--
At the moment, I do support BMPs but as image resources in the program. In other systems, id go with TGAs instead. This is only one method of going for it; others will probably have different ideas but perhaps this might give you some ideas as well
In my system the GUI will run in userspace and will render graphics using a video-independent API [which contains primitive routines] which in turn calls the current video driver. This allows multiple video drivers and graphics mode independent from the GUI, managed by the software Subsystem API called from a userspace program.
ie, like: program->SubSystem API->Video-independent API-> [...] ->Video driver
While it is planned to provide support for both VBE and generic video drivers, we currently only have a protected mode VGA driver.
Please keep in mind that this setup is just design.
--
At the moment, I do support BMPs but as image resources in the program. In other systems, id go with TGAs instead. This is only one method of going for it; others will probably have different ideas but perhaps this might give you some ideas as well
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: Anyone have ideas on implementing a GUI?
Hi, I wrote everything myself, as I seen it was needed. All you need is a little know how (code wise) and a lot of creativity. I found that it helped me to first create a draft of it in MSPaint first, then use PsShop to get the RGB values, and dimensions, then I just wrote code to draw it out.
Re: Anyone have ideas on implementing a GUI?
Well, last time I got graphics working, I first started out with some basic VESA stuff (higher resolutions and such). Then I wrote an invalidation-rectangle system (DAMN, that increases speed a lot) and wrote some convenience code (like alpha blending, mapping an RGBA value to an appropriate integral value based on the colour depth, etc.).
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
Re: Anyone have ideas on implementing a GUI?
Definitely mapping each control precisely does certainly increase redraw speed and helps to limit flickering. Just think how dumb it would be to refresh the entire screen every time you went to update a status bar...
Yeah, you have to have alpha blending if you want to create an illusion that something like an icon was selected in a browser window. Otherwise you'd have to waste major time toggling images. I just integrated mine into my main draw function and I toggle that on and off instead. lol... much faster.
Yeah, you have to have alpha blending if you want to create an illusion that something like an icon was selected in a browser window. Otherwise you'd have to waste major time toggling images. I just integrated mine into my main draw function and I toggle that on and off instead. lol... much faster.
- Combuster
- 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: Anyone have ideas on implementing a GUI?
Never heard of insets/outsets/dashed lines? You'll get up, down and selected states without having to replot the image, only the borders.neato wrote:Yeah, you have to have alpha blending if you want to create an illusion that something like an icon was selected in a browser window.
Re: Anyone have ideas on implementing a GUI?
Hello:
Would redrawing the screen every time the user moves the mouse be too slow? It seems though, that I should make my own primitives. (I've done it before, in VGA, I assume is is the same in SVGA)
David
Would redrawing the screen every time the user moves the mouse be too slow? It seems though, that I should make my own primitives. (I've done it before, in VGA, I assume is is the same in SVGA)
David
President of the Useless OS project
- Combuster
- 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: Anyone have ideas on implementing a GUI?
Ususally, yes.DavidBG wrote:Would redrawing the screen every time the user moves the mouse be too slow?
Re: Anyone have ideas on implementing a GUI?
You should redraw the old and the new rectangle of the mouse pointer only.
Re: Anyone have ideas on implementing a GUI?
Hello again:
Here is a silly question but I have searched and searched for an answer:
How do I plot a pixel in SVGA?
I already have a VESA Standard window initialized.
But I can only plot a pixel in VGA with int 0x10 if I move 0x0C into AH and the color into AL. Then I put the X and Y in CX and DX and call int 0x10. But this does not work in SVGA. I can't figure out how to do it directly either like with 0xA000. Any of you know how to do it in ASM?
Thanks!
P.S. Is double buffering slow? Or would that be a solution?
Here is a silly question but I have searched and searched for an answer:
How do I plot a pixel in SVGA?
I already have a VESA Standard window initialized.
But I can only plot a pixel in VGA with int 0x10 if I move 0x0C into AH and the color into AL. Then I put the X and Y in CX and DX and call int 0x10. But this does not work in SVGA. I can't figure out how to do it directly either like with 0xA000. Any of you know how to do it in ASM?
Thanks!
P.S. Is double buffering slow? Or would that be a solution?
President of the Useless OS project
Re: Anyone have ideas on implementing a GUI?
On second thought, Maybe I should start with a VGA GUI anyway, because I am in real-mode. I do not know how to use a GDT so I cannot go into protected-mode yet. This means I can't use more than the first 64k of the screen anyway.
I'll keep working at it, thanks for the ideas on how to go about it.
I'll keep working at it, thanks for the ideas on how to go about it.
President of the Useless OS project
- Combuster
- 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: Anyone have ideas on implementing a GUI?
Hmm, first hit on google for me: The manual. Includes fairly detailed instructions for a reference document.DavidBG wrote:Here is a silly question but I have searched and searched for an answer:
Re: Anyone have ideas on implementing a GUI?
AFAIK, GFX cards usually have a feature called "hardware cursors" (or something like that) allowing better performance.DavidBG wrote:Hello:
Would redrawing the screen every time the user moves the mouse be too slow? It seems though, that I should make my own primitives. (I've done it before, in VGA, I assume is is the same in SVGA)
David
Well, it does require you to (typically) add a buffer the size of the screen, to which you draw everything. Then, when you are finished drawing (or when the monitor refreshes), you swap the buffers. There is an article on the wiki called Double Buffering that you might want to check out.DavidBG wrote: P.S. Is double buffering slow? Or would that be a solution?
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
Re: Anyone have ideas on implementing a GUI?
When one icon is selected within an ocean of unselected icons, which is easier to see: A) A big blue rectangle. B) A tiny little dash line. It's all about trying to be friendly to as many users as possible and you're not going to get there by being lazy.Combuster wrote:Never heard of insets/outsets/dashed lines? You'll get up, down and selected states without having to replot the image, only the borders.neato wrote:Yeah, you have to have alpha blending if you want to create an illusion that something like an icon was selected in a browser window.
Re: Anyone have ideas on implementing a GUI?
VBE (and thus Super VGA) supports a way to switch between banks of the full video memory allowing you to be able to access the full video memory through that 64k "window". Look into "Bank Switching" with VBE; im sure there is plenty of tutorials on itDavidBG wrote:On second thought, Maybe I should start with a VGA GUI anyway, because I am in real-mode. I do not know how to use a GDT so I cannot go into protected-mode yet. This means I can't use more than the first 64k of the screen anyway,
On the use of double buffering, if it was possible, id go with page flipping over double buffering for a general graphics OS. Requires hardware support though, but does fix the issues involved with double buffering.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}