Help
Help
Help
Help
Help
Help Help Help Help Help Help Help Help
Help Help
Help
Go Back  Xtreme Visual Basic Talk > > > Help


Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2010, 11:50 AM
cody2094 cody2094 is offline
Newcomer
 
Join Date: Jan 2010
Posts: 1
Default Help


Okay, I am using the book, Visual Basic Game Programming for Teens. I am in the second chapter, and I have my code typed up for what it asked, I am supposed to clear the screen with a certain color and then refresh the screen. But it keeps popping up highliting d3d.GetAdapterDisplayMode D3DADAPTER_DEFAULT, dispmode I need to know what is wrong. Here is my code :

'---------------------------------------
'Visual Basic Game Programming for teens
'---------------------------------------

Dim dx As DirectX8
Dim d3d As Direct3D8
Dim d3dpp As D3DPRESENT_PARAMETERS
Dim dispmode As D3DDISPLAYMODE
Dim d3ddev As Direct3DDevice8

Private Sub Form_Load()
Set dx = New DirectX8

Set d3d = dx.Direct3DCreate()

d3dpp.hDeviceWindow = Me.hWnd
d3dpp.BackBufferCount = 1
d3dpp.BackBufferWidth = 640
d3dpp.BackBufferHeight = 480
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD
d3dpp.Windowed = 1
d3d.GetAdapterDisplayMode D3DADAPTER_DEFAULT, dispmode
d3dpp.BackBufferFormat = dispmode.Format

Set d3ddev = d3d.CreateDevice( _
D3DADAPTER_DEFAULT, _
D3DDEVTYPE_HAL, _
hWnd, _
D3DCREATE_SOFTWARE_VERTEXPROCESSING, _
d3dpp)


End Sub


Private Sub Form_Paint()
d3ddev.Clear 0, ByVal 0, D3DCLEAR_TARGET, RGB(255, 0, 0), 1#, 0

d3ddev.Present ByVal 0, ByVal 0, 0, ByVal 0
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Shutdown
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then Shutdown
End Sub

Private Sub Shutdown()
Set d3ddev = Nothing
Set d3d = Nothing
Set dx = Nothing
End
End Sub

Last edited by cody2094; 01-15-2010 at 12:03 PM.
Reply With Quote
  #2  
Old 01-15-2010, 05:11 PM
Iceplug's Avatar
IceplugHelp Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

What reason did it give you for that error?
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
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
Help
Help
Help Help
Help
Help
Help Help Help Help Help Help Help
Help
Help
 
Help
Help
 
-->