Sign in to follow this  

Directx 9 Surfaces

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

This topic is 4302 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this