wined3d: Construct the projection matrix directly in set_blit_dimension().
This saves a needless matrix multiplication and is actually more obvious than the glOrtho() call.
This commit is contained in:
parent
9893222184
commit
1c91b08220
|
@ -1666,13 +1666,20 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont
|
|||
}
|
||||
|
||||
/* GL locking is done by the caller */
|
||||
static inline void set_blit_dimension(UINT width, UINT height) {
|
||||
static void set_blit_dimension(UINT width, UINT height)
|
||||
{
|
||||
const GLdouble projection[] =
|
||||
{
|
||||
2.0 / width, 0.0, 0.0, 0.0,
|
||||
0.0, 2.0 / height, 0.0, 0.0,
|
||||
0.0, 0.0, 2.0, 0.0,
|
||||
-1.0, -1.0, -1.0, 1.0,
|
||||
};
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
checkGLcall("glMatrixMode(GL_PROJECTION)");
|
||||
glLoadIdentity();
|
||||
checkGLcall("glLoadIdentity()");
|
||||
glOrtho(0, width, 0, height, 0.0, -1.0);
|
||||
checkGLcall("glOrtho");
|
||||
glLoadMatrixd(projection);
|
||||
checkGLcall("glLoadMatrixd");
|
||||
glViewport(0, 0, width, height);
|
||||
checkGLcall("glViewport");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue