Some Ideas for text printing without GDI?
Ciao, to all
I'm thinkin' of my own font engine obviously bypassing GDI interface
DDraw 32 bit mode.
My idea was saving fonts as bmp files, in two colors.
Then loading them on surfaces setting as colorkey the one of font shape.
Obviously background color would be the same set as primary or back surface colorkey.
At the end creating surfaces of 1 pix RECT containing my desired colors.
So,
to blit a letter I should blit a color (resizing its dimension) on the letter surface and then I could blit the colored letter on the primary or back.
This is teory but before implementing my code I'd like to know if someone has other and maybe better ideas.
Quote:Original post by EmilianoGenghiniUse D3D and ID3DXFont instead [smile]
This is teory but before implementing my code I'd like to know if someone has other and maybe better ideas.
Is there a particular reason for using DDraw? It's likely slower than D3D, it's about 10 years old, and it's no longer being updated.
In any case. why do you want to bypass GDI? What's wrong with it? Why not go all the way and bypass DirectDraw and use BIOS interrupts to write pixels to the screen?
You were right with your last idea. As an old dos C/Assembly programmer I shold print my screens in 0xa000 location, and workin in 320x200 (no need for interrupts) maybe with near and far pointers, but there's the fukin windows...
However I just restarted my C programminq under win, I found DDraw maybe cause what I've read focused on it. I'll follow your advice if there's better tecnology right, something good to read?
Regading GDI, it's slow, and fonts depend from s/o ones so better to create your ones.
However I just restarted my C programminq under win, I found DDraw maybe cause what I've read focused on it. I'll follow your advice if there's better tecnology right, something good to read?
Regading GDI, it's slow, and fonts depend from s/o ones so better to create your ones.
Quote:Original post by EmilianoGenghiniI don't really know of any good tutorials I'm afraid. There's bound to be some in the forum FAQ though.
However I just restarted my C programminq under win, I found DDraw maybe cause what I've read focused on it. I'll follow your advice if there's better tecnology right, something good to read?
Quote:Original post by EmilianoGenghiniGDI is just as slow as drawing your own fonts, if you want to be as flexible as GDI (I.e. able to use truetype fonts). The usual way of handling fonts is to pre-render all the letters you need (at runtime) to a surface, and then copy from that surface when you draw the text. That's how ID3DXFont works, my text system, and most text engines out there.
Regading GDI, it's slow, and fonts depend from s/o ones so better to create your ones.
As for only being able to use installed fonts, you can always use AddFontMemResourceEx to install a font temporarily (It'll only be available to your app while it's running - it doesn't actually install the font, it just lets GDI calls use it).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement