I got my Direct3D window working. Now I am trying to draw a triangle, and it doesn't draw anything. I checked all the code several times, and I can't see anything wrong with it. I included the source with a MSVC++ 6 workspace and project.
I got my Direct3D window working. Now I am trying to draw a triangle, and it doesn't draw anything. I checked all the code several times, and I can't see anything wrong with it. I included the source with a MSVC++ 6 workspace and project.
I wont help you until you change your name to freedom fry.
hahahah, get it? Freedom fry? hahahaha.
c++->visualc++->directx->opengl->c++;
(it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)
LMAO...i sense a nickname coming on hahah
What's the problem? I'm running DX8 and when I ported it over to DX8.1 it wouldn't even create a window. You shouldn't pass
D3DCREATE_HARDWARE_VERTEXPROCESSING
You should let that be software vertex processing when you create the device. Not all video cards support that in hardware. Anyways, you should start checking more return values and then translate the HRESULT in a message. i just glanced through it and nothing really shot out at me but I'll look again tomorrow morning.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
The problem is, the triangle never draws. The clear command is working properly, but the triangle never is drawn on the screen.
edit: I've added error checking to every single DX function I made, and every time I call them, and I am not getting any errors whatsoever.
Last edited by frenchfry164; 03-15-2003 at 10:43 AM.
This is really weird. I copied the exact code from FillVertexBuffer() into StartDirect3D() and it worked. But I need it to work from FillVertexBuffer().
After seeing your last post its clear what the problem is. In your function FillVertexBuffer you take a pointer to the vertices. The function is prototyped as follow:
Whenever you so sizeof(vertices) in the code that will always return 4 because that is a pointer! You are receiving a pointer to an array in the function. You need to either pass in the size or find another way to do it.Code:HRESULT FillVertexBuffer( CUSTOM_VERTEX vertices[] );
sorry for reviving dead thread, but I was on vacation all week. Anywayz, I tried changing it to
and it still doesn't work!Code:if(FAILED(VertexBuffer->Lock(0, sizeof(CUSTOM_VERTEX)*3, (void**)&pVertices, 0))) return E_FAIL;
I thought your problem was it wouldn't work in the one function and I told you about the sizeof pointer issue. That didn't clear it up?
you were right. I forgot to change the sizeof() in the memcpy() too. I hate when I do stupid stuff like that, but I guess that is just learning