Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 08 Nov 2007
Offline Last Active Apr 13 2015 08:16 AM

Posts I've Made

In Topic: Checking the equality of objects in C#

14 January 2015 - 09:28 PM

Well, after some trial and error and taking the advice of Madhed into consideration, I've managed to fix it. turns out? I forget to set a value in the "addToList" method of the main form. Yup, it's always the simplest stuff that gets ya.

In Topic: Some help using vertex buffer with std::vector.

18 December 2014 - 12:13 AM

Your type naming is a little weird. Take for example:

VertexPC verts;

Shouldn't that be 'VertexPosColor'?

If 'VertexPosColor' is a vector, having it named in the singular sounds weird to me personally. I would named it VertexColorArray.


I'm going to assume 'verts' is supposed to be a vector, instead of a single vertex, so the rest of my post holds to that assumption.


sizeof() doesn't get the number of elements in an array or vector. std::vector.size() does that.

sizeof() gets the size, in bytes, of an object.


So this:

memcpy(data, &verts, sizeof(VertexPC));

Should be this:

memcpy(data, &verts[0], (sizeof(VertexPC) * verts.size()));

Starting at the address of the first vertex, not at the start of the vector class itself.


Unless I'm misreading your code. Which is likely, since I don't use DirectX. ohmy.png


Also this:

for (DemUINT x = 0; x < m_numVertices; ++x)
    verts = m_posColor[x];

Repeatedly assigns the same color to a single variable over and over again.

I love you..........what you suggested worked beautifully.....(sizeof(VertexPC) * vertex.size()) Thanks

In Topic: Generating a checkered pattern via dynamic textures in D3D9

22 October 2014 - 04:32 PM

Sorry to double post but I figured it out....


I just needed to do this: 

		d3dText->LockRect(0, &lockRect, 0, D3DLOCK_DISCARD);

		BYTE* data = (BYTE*)lockRect.pBits;
		for (unsigned int i = 0; i < d3dText->Width ; ++i)
			for (unsigned int j = 0; j < d3dText->Height  ; ++j)
				int index = i * lockRect.Pitch / 4 + j;

				if ((i / 32 + j / 32 ) % 2 == 0)
					*data++ = 255;
					*data++ = 0;
					*data++ = 0;
					*data++ = 255;
					*data++ = 255;
					*data++ = 255;
					*data++ = 255;
					*data++ = 255;

move the BYTE* data variable out of the for-loops..... stupid me.

In Topic: Generating a checkered pattern via dynamic textures in D3D9

22 October 2014 - 03:57 PM

Well, that didn't work......dang it. guess I'll wait a bit more for a good answer.

In Topic: Having a problem getting data from .obj file to render (index / Vertex buffer...

11 July 2014 - 06:04 AM

Also, check my dx9 c++ obj loader sample if you'd like: click


That helps a bit, but why use FVFs? I've noticed .X files (deprecated, yes), use vertex declarations (without loading effects). So it's possible to use vert decl without shaders, no?