I'm looking for a function in DirectX similar to this one in OpenGL: glGetIntegerv - http://msdn.microsof...7(v=vs.85).aspx
I'm not sure if I call it right but I need to save currently locked texture to a temporary LPDIRECT3DTEXTURE9 variable.
What I'm trying to reproduce from Opengl on DirectX is this:
GLuint old_tex;
glGetIntegerv(GL_TEXTURE_BINDING_2D, reinterpret_cast<GLint*>(&old_tex));
Would be very grateful for help!
edit: hmm actually I'm not sure if the above part of code is really needed in DirectX. The full code I'm trying to reproduce in DirectX comes from CEGUI source file and is as follows:
void OpenGLTexture::saveToMemory(void* buffer)
{
// save old texture binding
GLuint old_tex;
glGetIntegerv(GL_TEXTURE_BINDING_2D, reinterpret_cast<GLint*>(&old_tex));
glBindTexture(GL_TEXTURE_2D, d_ogltexture);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
// restore previous texture binding.
glBindTexture(GL_TEXTURE_2D, old_tex);
}
I didn't paste whole code at first becouse I thought I could manage with this part but it seems like I really can't find proper functions in DirectX . I've been searching a lot and tried using D3DXSaveTextureToFileInMemory instead of glGetTexImage, but it doesn't seem to work
void OpenGLTexture::saveToMemory(void* buffer)
{
// save old texture binding
GLuint old_tex;
glGetIntegerv(GL_TEXTURE_BINDING_2D, reinterpret_cast<GLint*>(&old_tex));
glBindTexture(GL_TEXTURE_2D, d_ogltexture);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
// restore previous texture binding.
glBindTexture(GL_TEXTURE_2D, old_tex);
}