|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
C++ Code Error?
I'm trying to use memcpy to set a vertex buffer for Direct3D but when I send the vertex array, it shuts the program. The memcpy definition asks for a const void * but I am using code that has worked on different machines with a normal void *. I have even gotten it to work before but I just added something that changes the verticies after they have been declared and now it won't work...
Sample code: struct D3DVERTEX { float x,y,z,nx,ny,nz; }; VOID *pVertex; D3DVERTEX cvVertex[]={{1,2,3,0.0f,0.0f,0.0f,},}; cvVertex.nx=5.0; memcpy(pVertex,cvVertex,sizeof(cvVertex)); -->CRASH!!! I have had the same problem when sending a dynamic string to MessageBox... I think it is a problem with sending dynamic to static but other people have gotten it to work!! Any suggestions? |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is your most prefered programming language? | Hailfire | Programming | 156 | 19-01-2005 21:42 |
| EMERGENCY! EPROM FULL error?!? | CHSguard72 | Programming | 2 | 05-03-2003 20:51 |
| Autonomous code | PBoss | Programming | 7 | 14-01-2003 15:29 |
| Does your team use the Default code. | Jeff McCune | General Forum | 2 | 09-01-2003 14:46 |
| Error found in programming for the pump and pressure switch | sjharobotics | Programming | 4 | 06-02-2002 17:46 |