[Solved] Drawing problem dx11

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Rebornxeno
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 85
Joined: Thu Jun 23, 2011 11:12 am

[Solved] Drawing problem dx11

Post by Rebornxeno »

Hey guys n gals (dandy), I have a problem with drawing in direct x 11. I am pretty familiar with how everything works, but this has thrown a curveball at me. Heres whats going on:

I have a struct that holds position data for vertices, and texture coords. Simple and easy. I can create an array of 3 of these using SimpleVertex sv[3] = {shit goes here}, upload to vertex buffer, draw, no problemo. Heres where i'm having trouble though, I can create an array like this SimpleVertex * sv = new SimpleVertex[3], fill out the info dynamically like sv[0].Pos = {shit goes here}. Okay. I fill all the info in, upload to vertex buffer, draw, nothing gets drawn.

So testing to see whats going on, I create a SimpleVertex *, and a SimpleVertex[], set the * to = [], so they should technically be the exact same, upload the * to vertex buffer, draw, nothing. Upload the [], draw, it shows. What am I missing here? I thought * and [] were practically the same?

In every draw, everything is filled out right, the difference is whether i'm using static or dynamic arrays. I am using drawinstance() call. Anyone know what might be the cause?

Oh just figured it out!!!! When updating the vertex buffer, when using STATIC arrays the array needs a & in front, and dynamic arrays DON'T!
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: [Solved] Drawing problem dx11

Post by dandymcgee »

Rebornxeno wrote:Hey guys n gals (dandy)
Lolwut? *Banned*
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Post Reply