Results 1 to 36 of 36

Thread: DirectX 9, should I upgrade to using it instead of 7?

  1. #1

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    DirectX 9, should I upgrade to using it instead of 7?

    I've been using DirectX 7 for my games i've made, this is mainly because DirectX8 was meant to have a bad rep for 2D programming and at the moment thats all i'm really doing. But DirectDraw is meant to be back in DirectX9 and I was wondering if theres lots of changes that I could benifit from if I start using DirectX9 instead of 7. I've still got to get round to downloading the SDK for 9 but hopefully I'll get round to it soon.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I think DX 9 doesn't have real VB support anymore, only .Net. And DirectDraw isn't back. It's not any more or less here than in DX 8. But Direct3D has some changes that make it easier to do 2D with the 3D capabilities.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Is DX9 out now???? I also heard rumors about DX9 having DDraw...but maybe it's wrong...

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Does DX9 have hardware rotation for 2D sprites? The way this were handled in DX8 made it very hard to do rotation, however it's easy enough to get around. Having it built-in (and faster) would be a real plus.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    NoteMe: no mention of such a thing in the "What's new?" part.

    What's New in DirectX Graphics

    --------------------------------------------------------------------------------

    This section describes Microsoft® DirectX® graphics features that are new in DirectX 9.0. See what's new in all of DirectX at What's New in DirectX 9.0.

    Programming Guide
    The programming guide has been reorganized into the following sections to help you find a topic.

    Converting to DirectX 9.0 - This page contains hints for converting applications to DirectX 9.0. See Converting to DirectX 9.0.
    Getting Started - Fundamental topics for getting started with Microsoft Direct3D®.
    Added a new page about DirectX 9.0 style vertex declarations. See Vertex Declaration.

    Fixed Function - Covers the functionality of the fixed function pipeline.
    Textures section - Added automatic generation of mipmaps. See Automatic Generation of Mipmaps.

    Programmable Pipeline - Many new features have been added to the shader models.
    Vertex and pixel shaders are no longer referred to with handles; they are objects. There is also a new section detailing the decoupling of vertex shaders and vertex declarations. See Component Object Model (COM) interfaces IDirect3DVertexShader9 and IDirect3DPixelShader9.

    Shaders and vertex stream declarations are no longer bound together at creation time. Vertex stream declarations are now expressed as an array of D3DVERTEXELEMENT9 elements. For more information, see Mapping Vertex Declarations and IDirect3DDevice9::SetFVF.

    Version 2 vertex shaders (vs_2_0) adds a limited form of flow control (loop...endloop, if...else...endif, and subroutines). Other features include more registers, constant setting methods (IDirect3DDevice9::SetVertexShaderConstantB, IDirect3DDevice9::SetVertexShaderConstantF, and IDirect3DDevice9::SetVertexShaderConstantI), new macro-ops for power, cross product, sign, absolute value, and linear interpolation. See Vertex Shader 2_0.

    Version 2 pixel shaders (ps_2_0) decoupled texture data and sampling by creating sampler registers in addition to the texture registers. Increased the instruction count and number of registers. Added float data types. Texture address and arithmetic instructions can now be intermixed. Eliminated all modifiers except negate. New macros and instructions include sincos (sine and cosine), normalization, cross product, power, linear interpolation, projected texture load, and biased level of detail (LOD) texture load. See Pixel Shader 2_0.

    Software shaders have been implemented to facilitate shader development without hardware support. The following software versions have been added: vs_2_sw, vs_3_sw, ps_2_sw, ps_3_sw.

    Extended shader versions take existing shader versions and extend their functionality if certain caps are set by the hardware. Extended functionality includes features like dynamic flow control, static flow control nesting, gradient instructions, and arbitrary swizzle. For more information, see Vertex Shader 2_0 Extended and Pixel Shader 2_0 Extended.

    Version 3 shaders further enhance the functionality of the extended shader versions without requiring caps to be set. Vertex shaders also add new support for vertex texturing, and control over how often vertex shader registers can be set during render calls. For more information, see Vertex Shader 3_0 and Pixel Shader 3_0.

    Advanced Topics - Lots of new tools and techniques.
    Adaptive tessellation can be applied to high-order primitives including N-patches, rectangle patches, and triangle patches based on the depth value of the control vertex in eye space. See Adaptive Tessellation.
    Asynchronous notifications - There are a number of interesting asynchronous queries that could be made on driver status. This new functionality uses new interfaces to add asynchronous query capability. See Asynchronous Notification and IDirect3DQuery9.
    Direct3D extensions (D3DX) - Added new functionality to the D3DX library to support new features, things like mesh functions, antialiased line drawing, pixel and vertex shaders, effects, math, and texturing functions. See Other Direct3D Extentions (D3DX).
    Displacement mapping - Added support for displacement maps using several single-channel signed formats. See Displacement Mapping.
    Gamma correction - Applications can indicate whether a texture is gamma 2.2 corrected (sRGB) or not so that the pipeline can perform gamma-correct blending. See Gamma.
    Line drawing - A new interface was added for drawing antialiased lines. See Direct3D Extentions (D3DX) Line Drawing or ID3DXLine.
    Multielement textures - This features allows applications to write out multiple elements of a texture simultaneously from a pixel shader. See Multielement Texture.
    Multiple render targets - Support for a single render target has been extended to support multiple render targets. See Multiple Render Target.
    Multihead - Multihead video cards use a common frame buffer and independent digital-to-analog converters (DACs) to offer more usable multiple-monitor support. See Multihead.
    Surface locking behavior - A new locking flag, D3DLOCK_DONOTWAIT, allows an application to gain back CPU cycles if the driver cannot lock the surface immediately. See D3DLOCK.
    Scissor test - The pipeline supports a scissor test, implemented with IDirect3DDevice9::SetScissorRect, IDirect3DDevice9::GetScissorRect, and a new render state, D3DRS_SCISSORTESTENABLE.
    Tessellation - Tessellator support has been extended to adaptively tessellate and look up per-vertex displacement values from a displacement map. See Tessellation.
    Two-sided stencil support - New support is available for adding shadows due to occluding geometry using shadow volumes. See Two-Sided Stencil.
    Tutorials, Samples, Tools, and Tips - All the samples and other helpful tips and tools are gathered here. See Tutorials, Samples, Tools, and Tips.
    Reference
    Many new pages have been added to the reference section including:

    Effects - ID3DXEffectCompiler, ID3DXBaseEffect, ID3DXEffect, ID3DXFragmentLinker, and ID3DXInclude. ID3DXSkinMesh was renamed ID3DXSkinInfo.
    Effects framework. A new interface, ID3DXEffectCompiler, allows the user to compile an effect from a function or from a vertex shader. The function can be written using the High-Level Shader Language.

    High-Level Language Reference - A high-level shader language exists for creating effects from vertex shaders. This gives developers the ability to create effects from a C-like language. For more information, see High-Level Shader Language.
    Shader Debugger - An extension to Microsoft Visual Studio® exists to support debugging some types of vertex shaders. For more information, see Shader Debugger.
    Other Features
    Other new features include the following:

    Dirty Regions. IDirect3DDevice9::Present now supports a dirty region by means of the fourth parameter, a pointer to a region.
    2-D Support. Added support for a color-converting blit between most types of D3DPOOL_DEFAULT surfaces while using IDirect3DDevice9::StretchRect, and a color fill operation for D3DPOOL_DEFAULT surfaces while using IDirect3DDevice9::ColorFill.
    Microsoft Windows® Graphics Device Interface (GDI) Interoperability. Two new methods have been added to get access to device contexts: IDirect3DSurface9::GetDC and IDirect3DSurface9::ReleaseDC.
    DrawIndexedPrimitive. IDirect3DDevice9:rawIndexedPrimitive has been changed to allow batching multiple primitives in the same index buffer without requiring multiple calls to IDirect3DDevice9::SetIndices.
    Texgen Mode. The new texgen mode is to support the OpenGL-style sphere map texgen. Requires a new render state: D3DVTXPCAPS_TEXGEN_SPHEREMAP. See D3DVTXPCAPS.
    ProcessVertices Behavior Change. This change enables multipass vertex processing and software pre-tessellation shaders. It enables IDirect3DDevice9::ProcessVertices to bypass the clipper and hence not compute the screen coordinates.
    Mesh Copy and Update Methods. ID3DXBaseMesh::CloneMesh is used to reformat and change the vertex data layout. For example, use it to to add space for normals, texture coordinates, colors, weights, etc. that were not present before. ID3DXBaseMesh::UpdateSemantics provides a method for updating the vertex declaration with different semantic information, without changing the layout of the vertex buffer. For example, use it to re-label a 3-D texture coordinate as a binormal or tangent, or vice versa.
    32-Bit Texture Formats. Two new 32-bit texture formats were added: D3DFMT_A8B8G8R8, D3DFMT_X8B8G8R8. See D3DFORMAT.
    Multisampling. A new multisampling control was added to give users control over performance versus quality. See SetDialogBoxMode, SetSampler, GetSamplerState, and D3DSAMPLERSTATE
    CreateImageSurface. Removed as a result of adding D3DPOOL_SCRATCH.
    Enumeration. IDirect3D9::EnumAdapterModes now takes a D3DFORMAT to support an expanding set of display modes.
    Sample Framework. The sample framework now includes a dialog box for supporting user selection of processing type, device type, etc. The sample framework has improved the enumeration of device caps also. See Sample Framework.
    Windowed Back Buffers. They can now be of a different format than the display. Added display modes with 10 bits per color channel. Added direct support for multihead adapters.
    CopyRects. This has been replaced by IDirect3DDevice9::UpdateSurface.
    State Blocks. These are no longer referred to with handles. They are now objects. See IDirect3DStateBlock9.
    Sas: haven't looked that much into it, but since DDraw hasn't changed since DX7 I don't think so.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Thanks CornedBee, if I have half an houre, maybe I will read it all...

  7. #7
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    It's not DirectDraw, it's Direct3D (using 3D for 2D).
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  8. #8
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Just like DX8 then....Only that this one is for .NET...

  9. #9
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    Uhh, it is DirectDraw - check here - http://msdn.microsoft.com/library/de...directdraw.asp

  10. #10
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Yes that was a nice page...(but the link didn't work)...but I belive you... I love DDraw....

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yes and no. This is the DirectDraw class of Managed DirectX, which represents DirectDraw in .Net. But it is not really part of DX9, it only reflects the capabilites of the DX7 DirectDraw into .Net.

    There is no IDirectDraw9 interface.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    ...hehhe...now it worked...and yes...that looks like DirectDraw...

  13. #13
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by CornedBee
    Yes and no. This is the DirectDraw class of Managed DirectX, which represents DirectDraw in .Net. But it is not really part of DX9, it only reflects the capabilites of the DX7 DirectDraw into .Net.

    There is no IDirectDraw9 interface.

    I'm so confused ...can't we just wait and see what we can do with it...

  14. #14
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You can do everything with it that you could do with DirectDraw in DX7. No more, no less.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  15. #15

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    So do I guess that I'll still really be using DirectX7 for DirectDraw but things like D3DSprites i'll be able to use DirectX9, if theres any point? I mean like making if my users will need DirectX9 instead of just DirectX7 when there could be no diffeance if I'm just use 2D.
    Oh well, I guess DirectX7 is for me, I also love DirectDraw
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  16. #16
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Originally posted by NoteMe
    Just like DX8 then....Only that this one is for .NET...
    It's not just for .NET, to C++ too!
    I really hate DDraw... why use DDraw when you can use untransformed vertices in DirectGraphics?
    ICQ: 128716725

  17. #17
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Originally posted by petrus
    It's not just for .NET, to C++ too!
    I really hate DDraw... why use DDraw when you can use untransformed vertices in DirectGraphics?
    There are often times when untransformed vertices will be much slower then a direct pixel for pixel blit. For instance, a wallpaper type background, in DDraw would simply be a pixel for pixel copy, untransformed vertices would still have to to texel to pixel mapping, writing to the z buffer, etc. An obvious waste of time. And you would still be off by .5 pixels =). And thats not even mentioning the creation of the vertex buffer to hold the vertices, the insertion, etc, etc.

    Z.

  18. #18
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Yes I am in with Z there...DDraw is good for what it is built for....

  19. #19
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Rotation? Alpha blend? Tint?
    ICQ: 128716725

  20. #20
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Who does that with wallpapers?

    Also, how do I overcome texture size limits when using D3D for 2d?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  21. #21
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Originally posted by CornedBee
    Who does that with wallpapers?

    Also, how do I overcome texture size limits when using D3D for 2d?
    Put the texture on two triangles, and scale them.
    ICQ: 128716725

  22. #22
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Sure. Scale a 256x256 texture to a 800x600 screen
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  23. #23
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Originally posted by CornedBee
    Sure. Scale a 256x256 texture to a 800x600 screen
    I meant; scale the triangles.
    It's very easy, make two triangles that form a rectangle that's filling the screen, and then apply a texture.
    ICQ: 128716725

  24. #24
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    So why go to the trouble of making the triangles in the first place. When you can just Blt it to the screen with DDraw...

  25. #25
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    But many video cards don't allow me to apply a texture larger than 256x256 to any triangles, so if I scale those two triangles the texture will be stretched and will look ugly. How do I avoid that?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  26. #26
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Originally posted by CornedBee
    But many video cards don't allow me to apply a texture larger than 256x256 to any triangles, so if I scale those two triangles the texture will be stretched and will look ugly. How do I avoid that?
    You can plot pixels in Direct 3D too...
    But, is there any rotation and alpha blend in Direct Draw?
    ICQ: 128716725

  27. #27
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    I don't know about alfa blend, but you don't use it in a 2D arcade game anyway. But you can rotate it. That is for sure...

  28. #28
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Originally posted by NoteMe
    I don't know about alfa blend, but you don't use it in a 2D arcade game anyway. But you can rotate it. That is for sure...
    Don't use alpha blend? How do you make shadows then?
    ICQ: 128716725

  29. #29
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Shadows in 2d arcade?

    And why would I use alpha blend or rotation for my background image?


    And how do I plot pixels in D3D?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  30. #30
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    What background are you talking about?
    Ploting pixels is just easy, lock the backbuffer and take that lockedrect, and you access the backbuffer as an array with all pixels.
    Last edited by petrus; Feb 23rd, 2003 at 05:58 PM.
    ICQ: 128716725

  31. #31
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    How can I lock in D3D?
    Those are serious questions btw, I really want to know.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  32. #32
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Originally posted by petrus
    What background are you talking about?
    Ploting pixels is just easy, lock the backbuffer and take that lockedrect, and you access the backbuffer as an array with all pixels.
    Which, of course, is slow.

    You seem to be missing the point. DirectGraphics may be nice, it may give you access to hardware alphablending and rotation, but in other situations, it falls apart (CornedBee has pointed out one).

    Z.

  33. #33
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Originally posted by CornedBee
    How can I lock in D3D?
    Those are serious questions btw, I really want to know.
    VisualBasic or C++?
    ICQ: 128716725

  34. #34
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    And as CornedBee said why would you use Alfa blend in a 2D arcade game...how many 2D arcade games have shadows?

  35. #35
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Originally posted by NoteMe
    And as CornedBee said why would you use Alfa blend in a 2D arcade game...how many 2D arcade games have shadows?
    And, you can make cool effects with alpha blend, such as smoke or cool HUD's.
    ICQ: 128716725

  36. #36
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    The various LockRect() functions.

    Z.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width