Jump to content
  • Advertisement
Sign in to follow this  
Thr3ad

Directx 9 Surfaces

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

I am trying to learn DX9 and have been working through some books to start getting things happening. I can create a window and set up the device and everything is all well. Next I wanted to display a jpg as a background so I have been using
LPDIRECT3DSURFACE9* surface;
	HRESULT hResult = pD3D9->CreateOffscreenPlainSurface(800,600,D3DFMT_UNKNOWN,D3DPOOL_DEFAULT,&surface,NULL);
but when I compile i get the error (82): error C2039: 'CreateOffscreenPlainSurface' : is not a member of 'IDirect3D9' I create the device like so
LPDIRECT3DDEVICE9 pD3DDevice = NULL;
	if ( FAILED( pD3D9->CreateDevice( D3DADAPTER_DEFAULT,
									  D3DDEVTYPE_HAL, hWnd,
									  D3DCREATE_SOFTWARE_VERTEXPROCESSING,
									  &D3Dpp, &pD3DDevice)))
Is there something simple i am doing wrong here? Thanks for looking

Share this post


Link to post
Share on other sites
Advertisement
From what I can see (sorry at work)-- it looks like your trying to create the surface from IDirect3D9, not the device

Example:

// Wrong
HRESULT hResult =
pD3D9->CreateOffscreenPlainSurface(800,600,D3DFMT_UNKNOWN,D3DPOOL_DEFAULT,&surface,NULL);

// Right
HRESULT hResult =
pD3DDevice->CreateOffscreenPlainSurface(800,600,D3DFMT_UNKNOWN,D3DPOOL_DEFAULT,&surface,NULL);




Share this post


Link to post
Share on other sites
Yep, that was it thanks very much. Perhaps this will teach me to take more breaks away from the screen.

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!