can anybody shed light on this?
EDIT: i viewed it one more time: it rendered the colors correctly for only a frame, so i just saw a flicker of red/blue/green, but then it only rendered the green side.
questions: have you checked the DWORD array you send in for the colors (i assume you have)?
EDIT: you must have been editing while i was writing.
other than that, i cant see where your going wrong...
[edited by - syrillix on April 12, 2004 7:54:06 PM]
Get busy livin' or get busy dyin'... - Shawshank RedemptionIf a man is talking in the forest, and no woman is around to hear him, is he still wrong? - UnknownFulcrum
This is the code that I used and it works fine for me. Granted its textured, but if u replace that with colors it should work. When I started I used just colors at first.
struct VertexXYZRHW_TU_TV { FLOAT x, y, z, rhw; // X, Y, Z and the RCW (for 2d Drawings) FLOAT tu, tv; // texture coordinates }; #define D3DFVF_VERTEX_XYZRHW_TEX ( D3DFVF_XYZRHW | D3DFVF_TEX1 )
i know it WORKS, because i saw a flash of the colors i wanted to see, but after that flicker of "correctness," it was just green. Here's a screen shot:
textured quads work for me, i'm writing a 2d sprite engine, but I can't draw colored quads correctly...grrr....
EDIT: note, i'm locking and unlocking the vertex buffer every frame, is that a reason why? should i just lock it once, fill in the data, and that's it?
EDIT2: no texture stages, and yes i did set textures before in the program, but i drew the quad first...wait a minute..that might be the cause...
EDIT3: Got it to work! I just had to g_pd3dDevice->SetTexture(0,NULL) in order for it to work! thanks a bunch.. [edited by - Cipher3D on April 12, 2004 8:06:27 PM]
[edited by - Cipher3D on April 12, 2004 8:07:16 PM]
[edited by - Cipher3D on April 12, 2004 8:09:54 PM]
since i didn''t want to bother asking in a second post, might as well ask here.
my question is, i''m using directinput for mouse input, but i''m using a windowed application. Since directinput only sends deltas, i can''t get the exact location of the mouse, relative to the client area of the application. whenever i click on a GUI button in my app, my mouse cursor is isually in a place where i don''t want it to be (such as my MSVC program), and then it switches to the program i accidentally clicked on...
Either use GetCursorPos to get mouse pos in screen coordinates and then ScreenToClient, or add up the deltas for yourselves. Don''t forget to clip the mouse pos on the screen borders though, the delta doesn''t care about that.