Page 1 of 1

Framebuffer drawing

Posted: Wed Jul 04, 2007 4:20 am
by Jeko
I need some code that implement framebuffer drawing. Have you something?

Posted: Wed Jul 04, 2007 4:39 am
by os64dev
dude, google or search the forum or the wiki. this has been mentioned a gazillion times before.

Posted: Thu Jul 05, 2007 5:38 am
by Jeko
os64dev wrote:dude, google or search the forum or the wiki. this has been mentioned a gazillion times before.
I've searched everywhere, but I can't find a good blit function. And I need also an optimized putpixel function. I've written a my function, but it's very slow!

Posted: Thu Jul 05, 2007 5:58 am
by Combuster
And I need also an optimized putpixel function. I've written a my function, but it's very slow!
- using putpixel to draw more than a pixel is always slow.
- use write-combining
I've searched everywhere
- search harder. How else did we figure the answer
but I can't find a good blit function
Then write your own. Blits are not difficult to do.

Also, its a good exercise to do your own optimisation instead of taking code and not knowing how it works.

I also suggest you read Michael Abrash - Graphics Programming Black Book. Its freely available as pdf and contains pretty much everything to get started.

Posted: Thu Jul 05, 2007 6:18 am
by os64dev
I've searched everywhere, but I can't find a good blit function. And I need also an optimized putpixel function. I've written a my function, but it's very slow!
Then start optimising it yourself once you can get it fast your domain knowledge has improved. This is also what you should do first. readf about how pixels are written in memory and how to handle different graphics formats 24-bit, 16-bit, 32-bit, 8-bit etc. Then you'll figure out that there is no such a thing a perfect blit function, but that each mode requires its own.
I also suggest you read Michael Abrash - Graphics Programming Black Book. Its freely available as pdf and contains pretty much everything to get started.
Good one, i also read this for my graphics functions.

Posted: Fri Jul 06, 2007 3:59 am
by Jeko
Combuster wrote:
And I need also an optimized putpixel function. I've written a my function, but it's very slow!
- using putpixel to draw more than a pixel is always slow.
- use write-combining
I've searched everywhere
- search harder. How else did we figure the answer
but I can't find a good blit function
Then write your own. Blits are not difficult to do.

Also, its a good exercise to do your own optimisation instead of taking code and not knowing how it works.

I also suggest you read Michael Abrash - Graphics Programming Black Book. Its freely available as pdf and contains pretty much everything to get started.
I implemented my own blit function. I know it's not difficult to do, but I wanted optimized code. However now I writed a good code, and graphic is quite fast also in bochs. Thank you!