How to compose my pictures?

Started by
6 comments, last by MannyCalavera 19 years, 8 months ago
Hi, I'm very new to DirectX and have some questions. (Sorry in advance for the language,I'm no native english speaker.) From my days with TBitmap :) I'm accustomed to the possibility to create an imageobject and draw something on it. Then I could use this image/bitmap/whatever and draw it on another or even only a part of it. With DirectX I'm not sure how to do this. I only want to show some 2D-Images on the screen which I want to alter on runtime. But I only have one backbuffer, I can't create a new one, draw a picture into it, alter it anyway I like and draw it then on another one to draw the composition in the end to the backbuffer. But things like this are exactly what I want to do. I hope someone sheds some light into this for me. Thanks in advance, Fingolfin
Advertisement
You either use Texture-objects or Surface-objects. These can be drawn using the ID3DXSprite object.
Thanks for the answer. Are there any well known advantages or disadvantages with either using surfaces or the textures themselves?

Thanks in advance,

Fingolfin
If you are doing Direct3D, you don't need to worry about the back buffer. Direct3D automatically handles that for you. Look into ID3DXSprite, it can do 2-dimensional quads for you.

It sounds to me like what you want is DirectDraw. It's been deprecated but you can still use it through the latest SDK. People will tell you to use Direct3D, but if you are sure you just want 2D and you don't need fancy effects, DirectDraw can be just as easy and give much lower system requirements.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
Hi,

I have to use DirectX9 so an older version is unfortunately no option. :(

But in fact I need many functions like DrawCircle which aren't anymore integrated in DirectX9 as I understand it. So, Sprites seem to be the way to go for 2d-like graphics operations but I also don't want to live without the "fancy effects".

Do you habe any ideas on that matter?

Fingolfin
You could get a device context (or a Graphics object, if using managed libraries) for, for example, drawing circles and lines using Win32 (or .net) native methods.

It is always good to know some theory of 3d before using d3d, even if you do only use it for 2d operations. Once you've solidly understood how to produce something on the screen, you quickly realize that the possibilities are there to draw anything you want.

So, read up! And ask more questions here, if feeling unsure about something.

Kind regards,
-Nik

Niko Suni

To draw circle,elipse and arc,use LineStrips.
To draw fill circle,elipse and arc,use TriangleFans.
Don't use GDI methods.


Hi, I would be interested in a similar thing. But I use ID3DXSprites. Can I combine them without problems with 3D-Objects (like a line made out of vertices)?

This topic is closed to new replies.

Advertisement