Jump to content
  • Advertisement
Sign in to follow this  
Kest

ID3DXSprite: Untextured quads?

This topic is 3892 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

Is there any way to render untextured quads with ID3DXSprite? I've tried simply passing a null pointer for the texture, but I get D3DERR_INVALIDCALL. I just want to render solid pixel-based colored rectangles. Do I need to hack it and create a 1x1 or 2x2 white pixel texture? Any help is appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Personally, I'd just knock up a dynamic vertex buffer and render quads from that. Aside from that, yeah - a 1x1 texture is the only real option - Although you could put several colours on one texture.

Share this post


Link to post
Share on other sites
I use ID3DXSprite to render all of my 2D graphical elements, so I would hate to set up an alternate system just to render solid rectangles. Is there any particular reason it throws an error when there's no texture applied? Or was it just an API development screw up?

Wouldn't other colors in the hack texture be useless? The ID3DXSprite::Draw function accepts a color modulation parameter.

Thanks for the information.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kest
I use ID3DXSprite to render all of my 2D graphical elements, so I would hate to set up an alternate system just to render solid rectangles. Is there any particular reason it throws an error when there's no texture applied? Or was it just an API development screw up?
Presumably ID3DXSprite was only ever intended to draw textured sprites. It's just a helper class after all, and doesn't cover lots of cases.

Quote:
Original post by Kest
Wouldn't other colors in the hack texture be useless? The ID3DXSprite::Draw function accepts a color modulation parameter.
Ah yes, I forgot about that...

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!