DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
Go Back  Xtreme Visual Basic Talk > > > > DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET


Reply
 
Thread Tools Display Modes
  #21  
Old 05-10-2005, 01:17 PM
JamesBowtell JamesBowtell is offline
Newcomer
 
Join Date: May 2005
Posts: 19
Default


Hey thanks for the help

managed to code the Graphics adapter name but still can't find the way to discover how much RAM it has!!

With your know how could you help...thanks

James Bowtell
Reply With Quote
  #22  
Old 05-11-2005, 01:08 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

Right, here goes :-) A complete enumeration module

Code:
    Sub listGeneralCaps(ByVal DevCaps As Caps, ByVal lstCaps As ListBox)
        lstCaps.Items.Add(" -----  General Caps ------------------------")
        If DevCaps.MaxActiveLights = -1 Then
            lstCaps.Items.Add("Maximum Active Lights: Unlimited")
        Else
            lstCaps.Items.Add("Maximum Active Lights: " & DevCaps.MaxActiveLights)
        End If
        If DevCaps.MaxPointSize = 1 Then
            lstCaps.Items.Add("Device does not support point size control")
        Else
            lstCaps.Items.Add("Maximum point primitive size: " & DevCaps.MaxPointSize)
        End If
        lstCaps.Items.Add("Maximum Primitives in each DrawPrimitives call: " & DevCaps.MaxPrimitiveCount)
        lstCaps.Items.Add("Maximum Textures simultaneously bound: " & DevCaps.MaxSimultaneousTextures)
        lstCaps.Items.Add("Maximum Texture aspect ratio: " & DevCaps.MaxTextureAspectRatio)
        lstCaps.Items.Add("Maximum Texture size: " & DevCaps.MaxTextureWidth & "x" & DevCaps.MaxTextureHeight)
        lstCaps.Items.Add("Maximum matrixes blending: " & DevCaps.MaxVertexBlendMatrices)
        lstCaps.Items.Add("Maximum vertex shaders registers: " & DevCaps.MaxVertexShaderConst)
    End Sub

    Sub ListTextureCaps(ByVal TextureCaps As TextureCaps, ByVal lstCaps As ListBox)
        lstCaps.Items.Add(" -----  Texture Caps ------------------------")
        If TextureCaps.SupportsPerspective Then
            lstCaps.Items.Add("Perspective correction texturing is supported. ")
        End If
        If TextureCaps.SupportsPower2 Then
            lstCaps.Items.Add("All textures must have widths and heights specified as powers of 2. This requirement does not apply to either cube textures or volume textures. ")
        End If
        If TextureCaps.SupportsAlpha Then
            lstCaps.Items.Add("Alpha in texture pixels is supported. ")
        End If
        If TextureCaps.SupportsSquareOnly Then
            lstCaps.Items.Add("All textures must be square. ")
        End If
        If TextureCaps.SupportsTextureRepeatNotScaledBySize Then
            lstCaps.Items.Add("Texture indices are not scaled by the texture size prior to interpolation. ")
        End If
        If TextureCaps.SupportsAlphaPalette Then
            lstCaps.Items.Add("Device can draw alpha from texture palettes. ")
        End If
        If TextureCaps.SupportsNonPower2Conditional Then
            lstCaps.Items.Add("Conditionally supports the use of textures with dimensions that are not powers of 2.. ")
        End If
        If TextureCaps.SupportsProjected Then
            lstCaps.Items.Add("Supports the projected texture transformation flag. ")
        End If
        If TextureCaps.SupportsCubeMap Then
            lstCaps.Items.Add("Supports cube textures. ")
        End If
        If TextureCaps.SupportsVolumeMap Then
            lstCaps.Items.Add("Device supports volume textures. ")
        End If
        If TextureCaps.SupportsMipMap Then
            lstCaps.Items.Add("Device supports mipmapped textures. ")
        End If
        If TextureCaps.SupportsMipVolumeMap Then
            lstCaps.Items.Add("Device supports mipmapped textures. ")
        End If
        If TextureCaps.SupportsMipCubeMap Then
            lstCaps.Items.Add("Device supports mipmapped cube textures. ")
        End If
        If TextureCaps.SupportsCubeMapPower2 Then
            lstCaps.Items.Add("Device requires that cube texture maps have dimensions specified as powers of 2. ")
        End If
        If TextureCaps.SupportsVolumeMapPower2 Then
            lstCaps.Items.Add("Device requires that volume texture maps have dimensions specified as powers of 2. ")
        End If
    End Sub

    Sub ListRasterCaps(ByVal RasterCaps As RasterCaps, ByVal lstCaps As ListBox)

        lstCaps.Items.Add(" -----  Rasterizer Caps ------------------------")
        If RasterCaps.SupportsDither Then
            lstCaps.Items.Add("The device can dither to improve color resolution.")
        End If


        If RasterCaps.SupportsZBufferTest Then
            lstCaps.Items.Add("The device can perform z-test operations.")
        End If

        If RasterCaps.SupportsFogVertex Then
            lstCaps.Items.Add("The device calculates the fog value during the lighting operation using the D3DTLVERTEX. ")
        End If

        If RasterCaps.SupportsFogTable Then
            lstCaps.Items.Add("The device calculates the fog value by referring to a lookup table.")
        End If

        If RasterCaps.SupportsMipMapLevelOfDetailBias Then
            lstCaps.Items.Add("The device supports level-of-detail (LOD) bias adjustments. ")
        End If

        If RasterCaps.SupportsDepthBias Then
            lstCaps.Items.Add("The device supports depth bias values.")
        End If

        If RasterCaps.SupportsZBufferLessHsr Then
            lstCaps.Items.Add("The device can perform hidden-surface removal (HSR) without requiring the allocation of a depth-buffer")
        End If

        If RasterCaps.SupportsFogRange Then
            lstCaps.Items.Add("The device supports range-based fog.")
        End If

        If RasterCaps.SupportsAnisotropy Then
            lstCaps.Items.Add("The device supports anisotropic filtering.")
        End If

        If RasterCaps.SupportsWBuffer Then
            lstCaps.Items.Add("The device supports depth buffering using w. ")
        End If

        If RasterCaps.SupportsWFog Then
            lstCaps.Items.Add("The device supports w-based fog. ")
        End If

        If RasterCaps.SupportsZFog Then
            lstCaps.Items.Add("The device supports z-based fog. ")
        End If

        If RasterCaps.SupportsColorPerspective Then
            lstCaps.Items.Add("The device iterates colors perspective correct.")
        End If
    End Sub

    Sub listDriverCaps(ByVal DriverCaps As DriverCaps, ByVal lstCaps As ListBox)

        lstCaps.Items.Add(" -----  Driver Caps ------------------------")
        If DriverCaps.SupportsDynamicTextures Then
            lstCaps.Items.Add("The driver support Dynamic Textures")
        End If

        If DriverCaps.CanCalibrateGamma Then
            lstCaps.Items.Add("The driver can automatically adjust the gamma ramp")
        End If

        If DriverCaps.SupportsFullscreenGamma Then
            lstCaps.Items.Add("The driver supports dynamic gamma ramp adjustment in full-screen mode. ")
        End If
    End Sub

    Sub ListDevCaps(ByVal DevCaps As DeviceCaps, ByVal lstCaps As ListBox)
        lstCaps.Items.Add(" -----  Device Caps ------------------------")

        If DevCaps.SupportsExecuteSystemMemory Then
            lstCaps.Items.Add("Device can use execute buffers from system memory.")
        End If

        If DevCaps.SupportsExecuteVideoMemory Then
            lstCaps.Items.Add("Device can use execute buffers from video memory. ")
        End If

        If DevCaps.SupportsTransformedVertexSystemMemory Then
            lstCaps.Items.Add("Device can use buffers from system memory for transformed and lit vertices. ")
        End If

        If DevCaps.SupportsTransformedVertexVideoMemory Then
            lstCaps.Items.Add("Device can use buffers from video memory for transformed and lit vertices. ")
        End If

        If DevCaps.SupportsTextureSystemMemory Then
            lstCaps.Items.Add("Device can retrieve textures from system memory. ")
        End If

        If DevCaps.SupportsTextureVideoMemory Then
            lstCaps.Items.Add("Device can retrieve textures from device memory.")
        End If

        If DevCaps.SupportsDrawPrimitivesTransformedVertex Then
            lstCaps.Items.Add("Device exports a DrawPrimitives-aware hardware abstraction layer (HAL).")
        End If

        If DevCaps.CanRenderAfterFlip Then
            lstCaps.Items.Add("Device can queue rendering commands after a page flip.")
        End If

        If DevCaps.SupportsTextureNonLocalVideoMemory Then
            lstCaps.Items.Add("Device can retrieve textures from nonlocal video memory. ")
        End If

        If DevCaps.SupportsSeparateTextureMemories Then
            lstCaps.Items.Add("Device is texturing from separate memory pools. ")
        End If

        If DevCaps.SupportsHardwareTransformAndLight Then
            lstCaps.Items.Add("Device can support transformation and lighting in hardware. ")
        End If

        If DevCaps.CanDrawSystemToNonLocal Then
            lstCaps.Items.Add("Device supports blits from system-memory textures to nonlocal video-memory textures. ")
        End If

        If DevCaps.SupportsHardwareRasterization Then
            lstCaps.Items.Add("Device has hardware acceleration for scene rasterization. ")
        End If

        If DevCaps.SupportsPureDevice Then
            lstCaps.Items.Add("Device can support rasterization, transform, lighting, and shading in hardware. ")
        End If

        If DevCaps.SupportsQuinticRtPatches Then
            lstCaps.Items.Add("Device supports quintic béziers and B-splines.")
        End If

        If DevCaps.SupportsRtPatches Then
            lstCaps.Items.Add("Device supports high-order surfaces. ")
        End If

        If DevCaps.SupportsRtPatchHandleZero Then
            lstCaps.Items.Add("High-order surfaces can be drawn efficiently using a handle value of 0. ")
        End If

        If DevCaps.SupportsNPatches Then
            lstCaps.Items.Add("Device supports N patches. ")
        End If

    End Sub
Do enjoy :-D
__________________
Cheers
Reply With Quote
  #23  
Old 05-11-2005, 02:29 AM
JamesBowtell JamesBowtell is offline
Newcomer
 
Join Date: May 2005
Posts: 19
Default

Cool shows loads of stuff bout an adapter.....how did you learn all this?...was looking at the stuff contained within the DirectX SDK wasn't sure what half the stuff did!

What i can gather from you code is that it gathers information:

General Caps
Texture Caps
Rasterizer Caps

and places the data attributes found in a Listbox

What are CAPs

And also are you telling me i can find them RAM ofan adapter using these CAPs??

Interested now....I like the look of DirectX

Thanks
Reply With Quote
  #24  
Old 05-11-2005, 02:32 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

Caps is capabilities. Some hardware devices don't allow certain things (lighting for example) so, if your creating something thats flexible with peoples graphics cards then its best to test for them. I know that there is a DirectX application (by Microsoft) that retrieves the information of the RAM, so I'd look into that.
__________________
Cheers
Reply With Quote
  #25  
Old 05-11-2005, 05:44 AM
JamesBowtell JamesBowtell is offline
Newcomer
 
Join Date: May 2005
Posts: 19
Default

Can you remember what that project name was...this Graphics Card RAM problem is doing my head in....lol
Reply With Quote
  #26  
Old 05-11-2005, 06:56 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

It's called DirectX Caps Viewer. It's part of the SDK.
__________________
Cheers
Reply With Quote
  #27  
Old 05-11-2005, 08:37 AM
JamesBowtell JamesBowtell is offline
Newcomer
 
Join Date: May 2005
Posts: 19
Default

What name space is the 'Caps' stuff under

Microsoft.Directx.Direct3d
Microsoft.Directx.DirectDraw..........

Sorry to be a pain!!!!

thanks
Reply With Quote
  #28  
Old 05-11-2005, 08:40 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

You define a variable:
Code:
Dim Caps As Direct3D.DeviceCaps
__________________
Cheers
Reply With Quote
  #29  
Old 05-11-2005, 10:59 AM
JamesBowtell JamesBowtell is offline
Newcomer
 
Join Date: May 2005
Posts: 19
Default

Totaly Stumped About Finding The Ram Of A Graphics Card Thanks Anyway.....

James Bowtell
Reply With Quote
  #30  
Old 05-11-2005, 04:42 PM
JamesBowtell JamesBowtell is offline
Newcomer
 
Join Date: May 2005
Posts: 19
Default

Righ....

i Have tracked down where to gather the Memory Info using the

Microsoft.DirectX.DirectDraw.Caps.VideoMemoryTotal
Code:
        
Imports Microsoft.DirectX.DirectDraw

Public Class Form2
    Inherits System.Windows.Forms.Form

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim objcaps As Microsoft.DirectX.DirectDraw.Caps
        TextBox1.Text = objcaps.VideoMemoryTotal()

    End Sub
End Class
when the form loads all i get is 0 in the textbox.....what i think the problem is...is that there is reference to what Adapter to check for it's RAM value

could you please help

thanks

Last edited by JamesBowtell; 05-11-2005 at 05:20 PM.
Reply With Quote
  #31  
Old 05-12-2005, 01:29 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

Here you go buddy! The video memory from the device:
Code:
Dim caps As Microsoft.DirectX.DirectDraw.GetCapsStruct
        Dim device As Microsoft.DirectX.DirectDraw.Device
        device = New Microsoft.DirectX.DirectDraw.Device(Microsoft.DirectX.DirectDraw.CreateFlags.HardwareOnly)
        caps = device.GetCaps
        caps.HardwareCaps.VideoMemoryTotal.ToString()
__________________
Cheers
Reply With Quote
  #32  
Old 05-12-2005, 02:48 AM
JamesBowtell JamesBowtell is offline
Newcomer
 
Join Date: May 2005
Posts: 19
Default

Thanks for that

Can you explain what this line means

device = New Microsoft.DirectX.DirectDraw.Device(Microsoft.DirectX.DirectDraw.Creat eFlags.HardwareOnly)
Reply With Quote
  #33  
Old 05-12-2005, 02:51 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

That line basically creates a DirectDraw device.
__________________
Cheers
Reply With Quote
  #34  
Old 05-13-2005, 08:22 AM
JamesBowtell JamesBowtell is offline
Newcomer
 
Join Date: May 2005
Posts: 19
Default

Hey

Thanks for the help over the past few days...can you suggest any good books for stuff we have discussed ?

Also is it possible to detect the System information using the DirectX 9 SDK???

Information such as:

Operating System
Processor Speed
RAM
Direct X version



thanks
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
 
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
DirectX 9 SDK Tutorials: works in C#.NET, having trouble in VB.NET
 
-->