Re: What does your OS look like? (Screen Shots..)
Posted: Fri Jan 01, 2016 3:17 am
U365 console. Still WIP with bugs.
The Place to Start for Operating System Developers
http://f.osdev.org/
Looks rather nice. You should add a cursor, though.catnikita255 wrote:U365 console. Still WIP with bugs.
I know.omarrx024 wrote:Looks rather nice. You should add a cursor, though.catnikita255 wrote:U365 console. Still WIP with bugs.
Yeah I was just testing. Normally it only runs with 1G.Roflo wrote:For your 12GB of ram
What are the odds, I just got mine yesterday too!omarrx024 wrote:Doesn't look like much, but I implemented a line-drawing algorithm:
You'll need a separate routine that draws horizontal line from a specified X/Y and width, and another that draws a vertical line from a specified X/Y and height. Then before actually drawing in your draw_line routine, you can arrange your values so that x2 > x1, and y2 > y1, then do something like this:cheapskate01 wrote:but for some reason, mine only does diagonal lines...
Code: Select all
if(x2 == x1)
{
draw_horizontal_line(x1, y1, x2-x1, color); // draw_horizontal_line(x,y,width,color)
} else if(y2 == y1)
{
draw_vertical_line(x1, y1, y2-y1, color); // draw_vertical_line(x,y,height,color)
} else
{
// your real line-drawing code goes here...
Okay, thanks; but I meant: If the line isn't horizontal or vertical, it is perfectly diagonal. It refuses to draw lines at a slope like yoursomarrx024 wrote:You'll need a separate routine that draws horizontal line from a specified X/Y and width, and another that draws a vertical line from a specified X/Y and height. Then before actually drawing in your draw_line routine, you can arrange your values so that x2 > x1, and y2 > y1, then do something like this:cheapskate01 wrote:but for some reason, mine only does diagonal lines...Code: Select all
if(x2 == x1) { draw_horizontal_line(x1, y1, x2-x1, color); // draw_horizontal_line(x,y,width,color) } else if(y2 == y1) { draw_vertical_line(x1, y1, y2-y1, color); // draw_vertical_line(x,y,height,color) } else { // your real line-drawing code goes here...
I used the naive line-drawing algorithm from this Wikipedia page.cheapskate01 wrote:Okay, thanks; but I meant: If the line isn't horizontal or vertical, it is perfectly diagonal. It refuses to draw lines at a slope like yours
Actually, it works perfectly fine with integer division. I'm not using any floating point numbers in this routine.Roflo wrote:Maybe you're using integer division.
I used Bresenham's, so It should've been alright, but idk...Roflo wrote:If cheapskate's using an other algorithm, he could have made the mistake of using integer divisions instead of floating/fixed point ones as required in the algorithm.