Rendering to textures in DirectX 9...
I have a big problem. I''m implementing texture based font engine, and to draw strings, it must prepare string texture by copying small pieces (characters) from bitmap font to new texture. The problem is, I don''t know how can I render from one texture to another! Could someone please help me? (I''m using D3D9)
But I''m using D3DXSPRITE to draw font, and as far as I know, it can only draw from textures. BTW, I''m programming in D3D for few months only, and this is my first encounter with surfaces. What''s the difference between textures and surfaces?
A texture contains one or more surfaces, depending on whether it has mipmap levels stored in it.
Level 0 surface is the texture''s first surface, you should copy the data into it.
To get the surface interface pointer (pSurf) from the texture''s first level, use IDirect3DTexture9::GetSurfaceLevel(0, &pSurf), copy the text to the said surface, and release the pSurf.
Level 0 surface is the texture''s first surface, you should copy the data into it.
To get the surface interface pointer (pSurf) from the texture''s first level, use IDirect3DTexture9::GetSurfaceLevel(0, &pSurf), copy the text to the said surface, and release the pSurf.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement