Original Post
this is part 2...I''m a newbie and trying to get on board and observe the gaming programming practices...thanks in advance
1. What is wrong with this function and why is it a problem?
COLOR *VidGetRenderColor( void )
{
COLOR *color;
color->r = 255;
color->g = 255;
color->b = 255;
color->a = 255;
return color;
}
// to me there''s no args passed in for this type of getmethod()?!
2. Given a world camera position, an "up" vector, and a world look-at position, write brief pseudo-code to build a camera look-at matrix. Assume a right-handed coordinate system.
3. What is wrong with this code?
#ifdef NO_ASSERT
#define ASSERT(x) /* nothing */
#else
#define ASSERT(x) { if ( !(x) ) { printf( "Assertion failed\n" ); exit(1); } }
#endif
unsigned char *AllocateBytes( unsigned int Count )
{
unsigned char *data;
ASSERT( data = ( unsigned char * ) malloc( Count ) );
return data;
}