Archived

This topic is now archived and is closed to further replies.

Call me a dummy, but whats D8.1's "Blit" method called?

This topic is 5588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In Direct3d? Well, DrawPrimitive in order to draw 2 primitives (triangles) that form a quad.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
Ummm no, i mean as completely 2D, no 3D at all
We never used to have to know anything about primitives verticies etc in Direct X 7, do we have to now? wont that make 2D games slower?

Yratelev

Share this post


Link to post
Share on other sites
Yratelev - it will make 2d games FASTER y a HUGE degree thanks to the tremendous hardware acceleration.

You seem to forget that 2d games are just a special case for 3d games - all objects are flat planes with texture, and the projection matrix is also a little special.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
well i think there is a big difference - 2D requires you just to copy rects of the surfaces to the primary one, 3D requires you to plug in matrices etc etc... so ill take that's a no to my question... I agree theres additional functionality, but i didnt want to learn the maths and code of 3D.

incidently that sprite thing is kinda what im looking for, so im happy now.

Yratelev

[edited by - Yratelev on August 27, 2002 8:46:57 AM]

[edited by - Yratelev on August 27, 2002 9:06:00 AM]

Share this post


Link to post
Share on other sites
Well, just as a note - when you go 2d with Direct3d, most matrices are turned of. There is a special VertexBuffer format where you trn in the folly transformed screen coordinates.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
The thing to remember about DX 8 is that there are no new DirectDraw interfaces. But because DX is backwards compatible, you can still use DDraw 7 interfaces as normal (or even older ones if you prefer).

Share this post


Link to post
Share on other sites
LPDIRECT3DDEVICE8 pDevice; //Valid Device Ptr
LPDIRECT3DTEXTURE8 pTexture; // Valid Texture

LPD3DXSPRITE* pSprite = NULL;
HRESULT hr = D3DXCreateSprite(pDevice,&pSprite);
if (FAILED(hr))
.. Oh Drat


pSprite->Draw(pTexture,NULL,NULL,ULL,0.0f,&D3DXVECTOR2(10.0f,10.0f),-1);

// Draws a texture at 10,10 coords on screen


pSprite->Draw(pTexture,NULL,NULL,ULL,0.0f,&D3DXVECTOR2(10.0f,10.0f),D3DCOLOR_ARGB(200,200,200,200))

// Draws a texture at 10,10 coords on screen using a transparency value of about 78% (based on 200 alpha color/255*100)


pSprite->Draw(pTexture,NULL,NULL,ULL,D3DXToRadian(50),&D3DXVECTOR2(10.0f,10.0f),-1);

// Draws a texture at 10,10 coords on screen rotated about 50 degrees.

etc. view the docs.






Share this post


Link to post
Share on other sites
Ok, so lets say thona, that I use your idea of quads. That means that i will be changing the renderstate for the textures once every 2 triangles, which every book or resource ive read strongly advises against it!! what do microsoft have to say about that?


Yratelev
Managing Director -

DarkArrow Systems


"Better Quality Russian Technology"

Share this post


Link to post
Share on other sites
Well, I dont think you ahve a performance problem here. Try not to "overchange".

* Dont forget that a DirectX Texture can handle multiple quad textures.
* Dont forget that you can batch your render operations - by using the z-Buffer (available also in orthogonal projection mode) you can render them in the order of texture, not in Z-order.
* Dont forget what performance you talk of. 3d games push today hundreds of thousands of triangles per second - I am playing with a terrain renderer where I plan on using 300.000 triangles just for the terrain, another 300.000 for the "environment objects" and another 300.000 for the game dynamic objects - ok, this is hard (planned for GF 5), but you get the idea. And I talk of hopefully around 80 FPS. You will propably push a couple of hundred vertices - not so much a problem.

Still, batch them. Group them. And you will be fine. Not really complicated - you just need a sound framework.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
hmmm fair doos, i havnt heard of the z-buffer technique so ill have to look up on that, im just trying to keep the requirements to a minimum to broaden my ''market''. Not everyone owns state of the art PC''s remember, mine for instance cant even handle HalfLife Counterstrike properly, but im happy with it (plus, my bros sitting on a 3Gz 256 ram GE Force 3), so hmm ok... ill see how it goes, I just dont think microsoft should have scrapped surface - to surface memcpy type thing... anyway cheers for ur help, definatly things to ponder over.



Yratelev
Managing Director -

DarkArrow Systems


"Better Quality Russian Technology"

Share this post


Link to post
Share on other sites
Well, z-buffer is in every 3d supporting card - you should have heard.

Now, it was not exactly MS choice only on how to scrap it - get the point: in proper operating systems you are never allowed to talk to the hardware. Period.

There can be a lot going on that you ahve no clue of - and are not supposed to see. Abstraction IS king. For example, youcan pack your textures now to use less memory.

How many quads do you THINK you will push? 500 per frame? thats not a high number.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
quote:
Actually, it should be
LPD3DXSPRITE pSprite = 0;


Both 0 and NULL should be converted to a null pointer. Shouldn''t they? And after what I''ve read it''s not necessarily the value 0, zero. Or?

Johan Ersvik

Share this post


Link to post
Share on other sites