C++ Games

Welcome Guest (Register -  Login)  Active Topics Active Topics Display List of Forum Members Memberlist Search The Forum Search Help Help
 Navigation

 Latest Forum Posts
» Need Bantumi VB Codes
Last Reply By acha22
» School Project -> VB Game
Last Reply By ruger
» Game Idea
Last Reply By ruger
» Careers in Gaming
Last Reply By tarun321
» vb2008 dx9 triangle
Last Reply By bluatigro
» GDI+ Flickering Problem
Last Reply By blupig
» VB2010
Last Reply By blupig
» modding xbox360 games project
Last Reply By blupig
» how to ? vb6 lesson
Last Reply By bluatigro
» Firing Bullet at an angle
Last Reply By bluatigro
» shading in vb2008
Last Reply By bluatigro
» Game-ready model shops
Last Reply By Tinlau
» pa help game of the generals..... 
Last Reply By peejay
» dart game
Last Reply By yik17
» Heeelp me someone
Last Reply By Miranu

General DirectX
 Vb games General DirectX
Subject Topic: vb2008 dx9 triangle Post ReplyPost New Topic
 vb2008 dx9 triangle
<< Prev Topic | Next Topic >>
bluatigro
Posted: January 07 2010 at 7:57am | IP Logged Quote bluatigro

Newbie
Newbie


Group: Newbie
Joined: December 10 2009
Location: Netherlands
Posts: 4

the folowing code shout show

a triangle . but dos not work

Code:

Imports Microsoft.DirectX

Imports Microsoft.DirectX.Direct3D

Public Class Form1

Private dev As Direct3D.Device

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

Dim prepar As New PresentParameters

prepar.Windowed = True

prepar.SwapEffect = SwapEffect.Discard

dev = New Device(0, DeviceType.Hardware _

, Me, CreateFlags.SoftwareVertexProcessing _

, prepar)

Me.SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.Opaque, True)

End SubPrivate Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

dev.Clear(ClearFlags.Target _

, Color.Black, 1.0F, 0)

dev.Present()

Dim sx% = Me.Width / 1000Dim sy% = Me.Height / 700Dim vertices As CustomVertex.TransformedColored() = New CustomVertex.TransformedColored(0 To 2) {} ''create an array of verticesvertices(0).Position = New Vector4(10 * sx, 10 * sy, 0, 1)

vertices(0).Color = &HFF0000FFvertices(1).Position = New Vector4(990 * sx, 10 * sy, 0, 1)

vertices(1).Color = &HFF00FF00vertices(2).Position = New Vector4(500 * sx, 690 * sy, 0, 1)

vertices(2).Color = &HFFFF0000dev.BeginScene() 'all drawings after this linedev.VertexFormat = CustomVertex.TransformedColored.Format

dev.DrawUserPrimitives(PrimitiveType.TriangleList, 1, vertices)

dev.EndScene() 'all drawings before this lineEnd Sub

End Class

it shows a empty screen . what wend wrong ?

 
Online Status: Offline
View bluatigro's Profile Search for other posts by bluatigro Back to Top
 
1 User(s) are browsing this topic, 1 Guest(s) and 0 Member(s)
0 Members:
<< Prev Topic General DirectX Next Topic >>

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You can vote in polls in this forum


[ Users browsing page: none ]

Terms and Conditions | Privacy | Contact Us

Copyright © 2010 VbGames. All rights reserved.

This site is best viewed at 1024x768 screen resolution.
Back to Top

Designed by Micronet Technologies