Skip to main content
gamedev.net
🔒 Locked

D3DXLoadTextureFromSurface

Started by CoolMike Jun 27, 2000 at 2:18 PM 2 replies 350+ views
Original Post
CoolMike
CoolMike
I am trying to use the D3DXLoadTextureFromSurface function to load a DirectDraw Surface onto a D3DX texture surface. I have something set up wrong but I''m not sure what it is. I can already get the D3DXCreateTextureFromFile function to work, but I need to use D3DXLoadTextureFromSurface so I can do color-keying type transparency. So anyways, could anybody give me some good setup parameters both for the LPDIRECTDRAWSURFACE7 buffer to be copied from and the IDirectDrawSurface7 I am copying to?
Shinkage
Shinkage
It seems to me that the D3DXLoadTextureFromSurface function is just made for copying one surface that has already been created into another (possibly into a specific mipmap level).
CoolMike
CoolMike
You are right. What I am trying to do is copy a standard LPDIRECTDRAWSURFACE7 surface to an IDirectDrawSurface7 surface (to use as a D3DX texture surface). Now I could be missing something simple here, so any input would be great. I just want to know how to get the picture data for my texture from another directdraw surface, instead of a *.bmp file.
Shinkage
Shinkage
Oh, ok then, I thought you were asking a different question. In that case, as I recall Microsoft claims that the fastest way of loading one surface into another is the IDirect3DDevice7::Load function because it is generally hardware accelerated. I''m betting that''s what D3DXLoadTextureFromSurface ends up calling and I''m not sure whether it will work with non-texture surfaces. I''m pretty sure you could just blt one surface into another.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.