Windowing Systems by Example: 1 - Complicated Rectangles

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
jojo
Member
Member
Posts: 138
Joined: Mon Apr 18, 2016 9:50 am
Libera.chat IRC: jojo
Location: New York New York

Windowing Systems by Example: 1 - Complicated Rectangles

Post by jojo »

http://www.trackze.ro/wsbe-complicated-rectangles/

Today, we start writing our first code in both JS and C to render some rather over-engineered rectangle objects to our framebuffer in order to lay the groundwork for something much more interesting.
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: Windowing Systems by Example: 1 - Complicated Rectangles

Post by Octacone »

jojo wrote:http://www.trackze.ro/wsbe-complicated-rectangles/

Today, we start writing our first code in both JS and C to render some rather over-engineered rectangle objects to our framebuffer in order to lay the groundwork for something much more interesting.

Code: Select all

You should change "Complicated" to "Simple". :D
This tutorial was extremely easy to follow. I am just wondering how are you going to introduce the input compatibility, not everybody has the same linear frame buffer or PS/2 driver. 
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
User avatar
jojo
Member
Member
Posts: 138
Joined: Mon Apr 18, 2016 9:50 am
Libera.chat IRC: jojo
Location: New York New York

Re: Windowing Systems by Example: 1 - Complicated Rectangles

Post by jojo »

The simple answer is abstraction.

Firstly, there's a lot of groundwork to cover before we even start playing with the mouse yet. But this is something that I'll be addressing in particular when the time comes. However, we're going to make the not-unrealistic assumption that you have written your mouse driver (and if not, will be linking to the ps2 mouse wiki article) and can either poll the mouse in the application thread or wait for mouse messages passed from the kernel or another thread. Either way, it doesn't really matter because we'll be abstracting that as a function that you yourself have to worry about the implementation of which will sit in our event loop.

So, that's the mouse, and your concern is well placed. But, to be blunt on the framebuffer, I don't see that as an issue. If you're working on a system built within the last decade and a half or so, you have access to a linear framebuffer via VESA, and it's by far the most compatible route. If you're toggling VGA registers, that's below the scope of this series. If you're screwing with some complicated hardware acceleration interface, that's above the scope of the series.

All of that said, I really thank you for your ongoing feedback. I kept this one really short and simple because I had gotten complaints about the previous rant being too long (which probably had more to do with its length in the context of its content than anything else) and was worried about making this one a similar slog. I've pretty obviously never done this kind of writing before, so I appreciate your patience and actually spending time looking at my work and giving me your criticism since that's totally critical in helping me find my way into that happy medium.
DevilGladiator
Posts: 11
Joined: Mon Aug 08, 2016 7:56 am

Re: Windowing Systems by Example: 1 - Complicated Rectangles

Post by DevilGladiator »

jojo wrote:http://www.trackze.ro/wsbe-complicated-rectangles/

Today, we start writing our first code in both JS and C to render some rather over-engineered rectangle objects to our framebuffer in order to lay the groundwork for something much more interesting.
I have checked it out and i have to say that it was an easy to follow tutorial also i have to say that it's nice to see some tutorials about gui and that i would love to see more in the future :wink: , keep going on like this,
User avatar
jojo
Member
Member
Posts: 138
Joined: Mon Apr 18, 2016 9:50 am
Libera.chat IRC: jojo
Location: New York New York

Re: Windowing Systems by Example: 1 - Complicated Rectangles

Post by jojo »

Thanks for the words of encouragement, DevilGladiator. I really appreciate it, and I certainly intend to continue plowing forward!
User avatar
jojo
Member
Member
Posts: 138
Joined: Mon Apr 18, 2016 9:50 am
Libera.chat IRC: jojo
Location: New York New York

Re: Windowing Systems by Example: 1 - Complicated Rectangles

Post by jojo »

Just wanted to update this for anyone that's been following: Due to popular demand, I have updated my code and my last article to only cover implementation in C. I also think this version is also just a way better article, so check it out!

http://trackze.ro/wsbe-complicated-rectangles/
Post Reply