Suggestion about creating DX9

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Suggestion about creating DX9

Post by Emil_halim »

Hi Niko

i really want to thank your for your great 3D Engine.

i have a suggestion for you, in CVideoDirectX9::initDriver Function could you please add the next line to it.

present.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;

this allow us to lock the back buffer of the Engine and make some stuff to
it.

thanks
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Hm, I could do this. Or I could add a more general solution for this, for example creating an IImage from the backbuffer. For what would you use this? Creating a screenshot or something?
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

I would love the screenshot functionality, I actually have some code that will work on Windows/DirectX to get a screenshot, but it's most likely not fit for the engine, since it's not cross platform and doesnt work with OpenGL.
Image
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Re: Suggestion about creating DX9

Post by Emil_halim »

Emil_halim wrote:Hi Niko

i really want to thank your for your great 3D Engine.

i have a suggestion for you, in CVideoDirectX9::initDriver Function could you please add the next line to it.

present.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;

this allow us to lock the back buffer of the Engine and make some stuff to
it.

thanks
Hi Niko

doing that allow you to apply many 2D effects, i am using BCX Language
{Basic TO C/C++ Translator}, and create a very small Library to help user
of BCX to use directx9, and made and convert many demos in 2D for them,
and also 3d.
now i want , ofcourse if you don not mind , Merge it with your Great Engine.
for using with BCX.
one thing that i made is playing a movie in the back ground & in the same
time there is a rotating cube in front , each side of the Cube has it's aimation
stuff,

any way, to allow your BackGround to be locked , will extend yor Engine,and
take a screenshot , playing movie,and many effacts.

thanks
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

Hi , it's Me again

just want to show you that , how it is so simple to take a screeshot with DX9

Code: Select all

IDirect3DDevice9*  D3D_Device;
IDirect3DSurface9* BCX_BackBuf;
SExposedVideoData Dat = irrVideo->getExposedVideoData(); 
D3D_Device = Dat.D3D9.D3DDev9;  
D3D_Device->GetBackBuffer(0,0,D3DBACKBUFFER_TYPE_MONO,&BCX_BackBuf);
D3DXSaveSurfaceToFile(filename$,format,BCX_BackBuf,NULL,NULL);
sorry i do not know about OpenGl
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Ah, I understand. For doing something like writing video data to the screen, you currently could just create a new texture, lock it and draw2D it to the screen. Other things like reading screendata is not possible currently right. But should be added.
Dood

Post by Dood »

Hi , it's Me again

just want to show you that , how it is so simple to take a screeshot with DX9

code:
...
Indeed !
Now go look in IrrlichtNX code that does screenshots, and you will find out why i said it's bloated.
Unfortunately this is not the only example...

BTW This this will save the image in several popular formats, bmp,jpg,png etc..
however i think that's not the case with IrrNX implementation.
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

yes you can do it for a texture, but when you come to playing a movie in background it is better to draw a movie frame directly to the back buffer,so
it is more faster than drawing to a textuer then draw it to the screen.

i hope you get my point

thanks
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

Dood wrote:
Hi , it's Me again

just want to show you that , how it is so simple to take a screeshot with DX9

code:
...
Indeed !
Now go look in IrrlichtNX code that does screenshots, and you will find out why i said it's bloated.
Unfortunately this is not the only example...

BTW This this will save the image in several popular formats, bmp,jpg,png etc..
however i think that's not the case with IrrNX implementation.
i really do not know much about it, some one point me to it's site,but still
not download it yet.
Post Reply