Framebuffer drawing

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
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Framebuffer drawing

Post by Jeko »

I need some code that implement framebuffer drawing. Have you something?
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

dude, google or search the forum or the wiki. this has been mentioned a gazillion times before.
Author of COBOS
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post 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!
User avatar
Combuster
Member
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:

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post 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.
Author of COBOS
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post 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!
Post Reply