Jump to content
  • Advertisement
Sign in to follow this  
ArgusMaker

[DX9 C++] Texture (creating from file and drawing on screen)

This topic is 2773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Could you please write here some links to examples on how to use surfaces with DX9 and C++?
you know.. examples about creating them, loading external image files on them, drawing them , copying them to the backbuffer..
it would be helpful to me, i can't find anything with google

Share this post


Link to post
Share on other sites
Advertisement
[font="Calibri"]I sound like you are locking for the wrong thing. What you want to do should be done with textures not with surfaces. You should have a look at the texture sample from the sdk.[/font]

Share this post


Link to post
Share on other sites
No, i need surfaces e.g. to draw with the device on them (DrawPrimitive & similar) and copy a part of my drawing onto my backbuffer.

Share this post


Link to post
Share on other sites
[font="Calibri"]You still do this with textures. The technique you are looking for is called render to texture.[/font]

Share this post


Link to post
Share on other sites
Ok, thank you, but i still need help.
I can create a texture using D3DXCreateTextureFromFile, it fills a IDirect3DTexture9** variable with a correct pointer to Direct3DTexture9.
My problem is when it comes to draw the texture on screen using:
//fill 4 vertexes with x,y,z,diffuse_color,u,v
device->SetTexture(..)
device->SetFvF(..)
device->DrawPrimitiveUP(...)

SetTexture method wants a IDirect3DBaseTexture9* as second parameter, and not a IDirect3DTexture9* !blink.gif

Share this post


Link to post
Share on other sites
IDirect3DTexture9 derives from IDirect3DBaseTexture9, so you can pass a IDirect3DTexture9* wherever you need a IDirect3DBaseTexture9*.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!