Window Manager
stevenmess2004
Posts: 1,102
This is a window manager I have been working on. It currently draws windows, text, text boxes and vector sprites. I plan to add pixel sprites soon.
I am going to clean it up a bit and then fix it so it works with DOL. When thats done I will change the mouse driver so that you can register buttons and things and then we can have event driven code.
Run the program and the display will change after about a minute
This is only single buffered, but if the screen is only updated when required I don't think this will be a problem.
Issues
-The bottom of the screen is wrapping around to the top and there is some garbage in the top left hand corner so there
-must be a problem with the pointers to the screen array somewhere. If anyone can see where the problem is I would greatly appreciate it.
I am going to clean it up a bit and then fix it so it works with DOL. When thats done I will change the mouse driver so that you can register buttons and things and then we can have event driven code.
Run the program and the display will change after about a minute
This is only single buffered, but if the screen is only updated when required I don't think this will be a problem.
Issues
-The bottom of the screen is wrapping around to the top and there is some garbage in the top left hand corner so there
-must be a problem with the pointers to the screen array somewhere. If anyone can see where the problem is I would greatly appreciate it.
Comments
In the text box at the moment I am just using a fixed width. While this works sometimes it does not work very well.
Steven
So a string of n characters has simply a width of
spacing*(n-1) + chartacter-width
spacing is the spacing that is set in the graphics routines - normally 6?
n is the number of characters
what is character-width?
Steven
8*x_scale
- or so, I am not quite sure at the moment whether the standard charcter size is 8 or 6....
I am also not quite sure whether x_scale might also influence the "spacing" parameter... I shall have a look
----
Edit:
It multiplies.. So the correct formula should be:
string_of_N_characters_width = (spacing*(N-1) + 6)*x_scale
Post Edited (deSilva) : 2/3/2008 12:11:11 AM GMT
string_of_N_characters_width = (spacing*(N-1) + 6)*x_scale
and not
string_of_N_characters_width = (spacing*(N) )*x_scale
the default spacing is 6.
Now for a question. In the TV driver is the following
'' bits 15..10: select the colorset* for the associated pixel tile
'' bits 9..0: select the pixelgroup** address %ppppppppppcccc00 (p=address, c=0..15)
Is something the wrong way around here? Aren't the 6 right bits bits 0 to 5 and not 15 to 10?
Also, the address for the pixelgroup is only 10 bits. This is not enough to address the whole memory so how do you set where the tile is in memory?
Thanks
Steven
The upper 6 bits contain a number between 0 and 63 indicating the entry in the COLOR vector. Working in 4-colour mode, this entry is a LONG and contains the TV settings of color #0 to color #3, one byte each (4 bits chroma wheel, 1 bit chroma enable, 3 bits luma - but mind 0,1, and 7!!)
The next 10 bits contain the address divided by 64 of the tile to place (64 bytes = 16X16X2 bits)
This is a nuissance as those tiles must be aligned correctly, but the glyphs in the ROM are...
This is also well described in the wiki I think...
Post Edited (deSilva) : 2/3/2008 11:18:32 AM GMT
Thanks again
Steven
But there was not yet so much explanation in the wiki as I though... I sometimes mix-up my own unpublished notes, forum postings, Andre's Hydra book, and the Wiki...
What I was thinking of is this - however not very comprehensiv.. propeller.wikispaces.com/Converting+Text+Output+Display+Type
Post Edited (deSilva) : 2/4/2008 9:21:51 AM GMT
Changes
-Thanks to deSilva the bitmap is now correctly aligned and will display properly all the time
-You can now set any window to be the top window using the setTop method
-You can now redraw just one window if you want. This will only work if the window is the top window and cover the same or greater area than before
It isn't really documented and I probably update this version anymore unless someone wants to use it because I am going to work on making it work on DOL. DOL will allow you to dynamically allocate memory for windows and window contents and other things so I think it will be more flexible.
If someone does want to use this than I would be glad to do some documentation of this. Just leave a note in this thread.
Steven