Stefan Dösinger : wined3d: Create the state table.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Dec 7 14:23:44 CST 2006


Module: wine
Branch: master
Commit: c0268c7840bdf3a3eb4c6a096732f616c8af756d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c0268c7840bdf3a3eb4c6a096732f616c8af756d

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue Dec  5 23:36:10 2006 +0100

wined3d: Create the state table.

---

 dlls/wined3d/Makefile.in       |    1 +
 dlls/wined3d/state.c           |   38 ++++++++++++++++++++++++++++++++++++++
 dlls/wined3d/wined3d_private.h |   12 ++++++++++++
 3 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/Makefile.in b/dlls/wined3d/Makefile.in
index 2eea53c..0cdd967 100644
--- a/dlls/wined3d/Makefile.in
+++ b/dlls/wined3d/Makefile.in
@@ -22,6 +22,7 @@ C_SRCS = \
 	pixelshader.c \
 	query.c \
 	resource.c \
+	state.c \
 	stateblock.c \
 	surface.c \
 	surface_gdi.c \
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
new file mode 100644
index 0000000..2b929b6
--- /dev/null
+++ b/dlls/wined3d/state.c
@@ -0,0 +1,38 @@
+/*
+ * Direct3D state management
+ *
+ * Copyright 2006 Stefan Dösinger for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+#include <stdio.h>
+#ifdef HAVE_FLOAT_H
+# include <float.h>
+#endif
+#include "wined3d_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3d);
+
+static void state_unknown(DWORD state, IWineD3DStateBlockImpl *stateblock) {
+    FIXME("Unknown state %d\n", state);
+}
+
+const struct StateEntry StateTable[] =
+{
+      /* State name                                         representative,                                     apply function */
+    { /* 0,  Undefined                              */      0,                                                  state_unknown     },
+};
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8eea594..42ecbcd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -407,6 +407,18 @@ DWORD get_flexible_vertex_size(DWORD d3d
 #define GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, tex_num) \
     (((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
 
+/* Routines and structures related to state management */
+typedef void (*APPLYSTATEFUNC)(DWORD state, IWineD3DStateBlockImpl *stateblock);
+
+struct StateEntry
+{
+    DWORD           representative;
+    APPLYSTATEFUNC  apply;
+};
+
+/* Global state table */
+extern const struct StateEntry StateTable[];
+
 /* Routine to fill gl caps for swapchains and IWineD3D */
 BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display);
 




More information about the wine-cvs mailing list