Author Topic: 2D geometry in directx  (Read 3215 times)

0 Members and 1 Guest are viewing this topic.

Offline spitfire

  • Amiga 1200
  • ****
  • Posts: 275
  • Karma: 9
    • View Profile
2D geometry in directx
« on: September 24, 2007 »
Whats the best way to draw 2D interactive geometry? i.e. not just bitmaps. I know theres some kind of performance problem with drawing to or filling many quads over and over, but will it neccissarily be slower than software rendering (in an extreme case)?

To give an example, user selects a circle and drags it till its larger, then rotates 2 paralell tangents into position. There will be a TON of geometry like this.

Do you think pixel shaders would be usefull for this?

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: 2D geometry in directx
« Reply #1 on: September 24, 2007 »
@spitfire:
if you code it correctly with DX, hardware based things will be always faster as software rendering. Btw, why using software rendering, when ppl having hardware accelated graphic cards? ^^  Btw, DX dont support any direct 2d drawing like circle and so on... you have to do it yourself...   If you only want display a lot of sprites (textures) and want to change the color of them, you dont need any PS stuff... btw, i dont know why so many ppl are using pixel shaders for things you dont really need them ^^

Btw, dont use DirectDraw its old and slow...
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: 2D geometry in directx
« Reply #2 on: September 26, 2007 »
don`t know much about dx but in gl i would work with ortho projection getting rid of the z coord then its a matter of drawing shapes out of boxes,triangles and lines and rotating and scaling them with gl`s model view matrix. doing all this with a good engine that culls of objects falling out of the screen and that uses display lists/vertex buffers you could draw many thousands of objects rotating and moving on even modest hardware.
Challenge Trophies Won: