利用者:AlexK/Gsoc2012/MatrixStack

提供: wiki
移動先: 案内検索

With SwissCheese branch, blender uses it is own implementation of OpenGL Matrix Stack in order to make blender compatible with OpenGL ES, OpenGL 3.0+ and possibly, in the future DirectX. This implementation is based on OpenGL design and uses matrix mode switches. In the future, the design can become more object (mode) oriented.

void gpuMatrixCommit(void);

Commits the all modified matrices to video card. Needs to be called before glDraw* functions. gpuBegin, gpu* commit the matrices automatically, so there is no need to call gpuMatrixCommit(). gpuMatrixCommit() check if matrix is current in video card so it is not expensive call.

void GPU_matrix_forced_update(void);

Like gpuMatrixCommit(), but does force update.

void gpuMatrixLock(void);
void gpuMatrixUnlock(void);

Not needed anymore. It was used for compatibility bridge.


OpenGL function Blender function
void glPushMatrix(void);
void glPopMatrix(void);
void glMatrixMode(GLenum  mode);
void glLoadIdentity(void);
void glLoadMatrixf(const GLfloat *  m);
void glMultMatrix(const GLfloat *m);
void glMultMatrixd(const GLdouble *  m);
void glTranslatef(GLfloat x, GLfloat y, GLfloat z);
void glScalef(GLfloat x, GLfloat y, GLfloat z);
void gpuPushMatrix(void);
void gpuPopMatrix(void);
void gpuMatrixMode(GLenum mode);
void gpuLoadIdentity(void);
void gpuLoadMatrix(const GLfloat * m);
void gpuMultMatrix(const GLfloat *m);
void gpuMultMatrixd(const double *m);
void gpuTranslate(GLfloat x, GLfloat y, GLfloat z);
void gpuScale(GLfloat x, GLfloat y, GLfloat z);