Henri Verbeet : wined3d: Construct the projection matrix directly in set_blit_dimension().
Alexandre Julliard
julliard at winehq.org
Wed Nov 2 14:23:35 CDT 2011
Module: wine
Branch: master
Commit: 1c91b082203bb62e7a28c63fd9befc391d29ad7f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1c91b082203bb62e7a28c63fd9befc391d29ad7f
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue Nov 1 20:15:18 2011 +0100
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.
---
dlls/wined3d/context.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 29d0b3f..31a604c 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -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");
}
More information about the wine-cvs
mailing list