Jump to content
  • Advertisement
Sign in to follow this  

Drawing a sprite

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

Im getting an unknown exception on my sprites Draw function

My Header:

#ifndef DRAW_PANEL_H
#define DRAW_PANEL_H

#include "MAIN.h"


void InitD3D(HWND);
void InitSprite();
void RenderFrame();
void D3DCleanUp();



LPD3DXSPRITE _drawSprite;



and the significant part of my cpp file:

void DRAW_PANEL::InitSprite()
if(FAILED(D3DXCreateSprite(_d3dDev, &_drawSprite)))
MessageBox(NULL, "InitSprite Failure", "InitSprite Failure", NULL);

D3DXCreateTextureFromFile(_d3dDev, "testBG.BMP", &_background);


void DRAW_PANEL::RenderFrame()


_drawSprite->Draw(_background, NULL, NULL, NULL, 0xFFFFFFFF);


_d3dDev->Present(NULL, NULL, NULL, NULL);

Edit: I debugged and found my texture wasn't loading properly, I needed to tack on the full path, problem solved =D

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!