Forum guidelines
Simple Dot Rendering
Posted By jan.balcarik on 05 Mar 2005
First I want to say I'm very new to directx. I'm trying to build a simple game. I already have a loop and sort of GameTimer. With this I was able to render a "color-fading" background. But offcourse I want more ;-). I'm trying to render a group of dots. this is my dot-array: public CustomVertex.TransformedColored[] DotData; And I'm trying to fill it this way: for(int i = 0; i < 100; i++) { DotData[0].X = rand.Next(100); DotData[i].Y = rand.Next(100); DotData[i].Z = 1.0f; DotData[i].Rhw = 1.0f; DotData[i].Color = Color.FromArgb(rand.Next(200) + 55, rand.Next(200) + 55, rand.Next(200) + 55).ToArgb(); } Compiling goes well, but when i launch the application I get this error (translated from dutch to english): The appication generated an exeption wich cannot be processed. Process-id=0xb48 (2888), thread-id=0xf04 (3844) Click OK to close the application. Click CANCEL to track errors in the application. When I click cancel it says the error-tracker isn't available. And when I click OK the application exits. This code produces the same error: DotData[0].X = 10; And when I comment that line all works well (no dots offcourse, but I do see the fading BG). Does anyone know what is wrong? Thanks in advance, Jules
Download Free eBooks


Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.