/[pcsx2_0.9.7]/trunk/3rdparty/Cg/cgD3D8.h
ViewVC logotype

Contents of /trunk/3rdparty/Cg/cgD3D8.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 290 - (show annotations) (download)
Sat Dec 25 02:51:30 2010 UTC (9 years ago) by william
File MIME type: text/plain
File size: 7158 byte(s)
Auto Commited Import of: pcsx2-0.9.7-DEBUG (upstream: v0.9.7.4139 local: v0.9.7.283-latest) in ./trunk
1 /*
2 *
3 * Copyright (c) 2002-2010, NVIDIA Corporation.
4 *
5 *
6 *
7 * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
8 * of your agreement to the following terms, and your use, installation,
9 * modification or redistribution of this NVIDIA software constitutes
10 * acceptance of these terms. If you do not agree with these terms, please do
11 * not use, install, modify or redistribute this NVIDIA software.
12 *
13 *
14 *
15 * In consideration of your agreement to abide by the following terms, and
16 * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
17 * under NVIDIA's copyrights in this original NVIDIA software (the "NVIDIA
18 * Software"), to use, reproduce, modify and redistribute the NVIDIA
19 * Software, with or without modifications, in source and/or binary forms;
20 * provided that if you redistribute the NVIDIA Software, you must retain the
21 * copyright notice of NVIDIA, this notice and the following text and
22 * disclaimers in all such redistributions of the NVIDIA Software. Neither the
23 * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
24 * to endorse or promote products derived from the NVIDIA Software without
25 * specific prior written permission from NVIDIA. Except as expressly stated
26 * in this notice, no other rights or licenses express or implied, are granted
27 * by NVIDIA herein, including but not limited to any patent rights that may be
28 * infringed by your derivative works or by other works in which the NVIDIA
29 * Software may be incorporated. No hardware is licensed hereunder.
30 *
31 *
32 *
33 * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
34 * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
35 * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
36 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
37 * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
38 *
39 *
40 *
41 * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
42 * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
43 * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
44 * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
45 * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
46 * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
47 * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
48 * OF THE POSSIBILITY OF SUCH DAMAGE.
49 *
50 */
51
52 #ifndef CGD3D8_INCLUDED
53 #define CGD3D8_INCLUDED
54
55 #ifdef _WIN32
56
57 #pragma once
58
59 #include "cg.h"
60
61 #include <d3d8.h>
62 #include <d3dx8.h>
63 #include <windows.h>
64
65 /* Set up for either Win32 import/export/lib. */
66
67 #ifdef CGD3D8DLL_EXPORTS
68 # define CGD3D8DLL_API __declspec(dllexport)
69 #elif defined(CG_LIB)
70 # define CGD3D8DLL_API
71 #else
72 # define CGD3D8DLL_API __declspec(dllimport)
73 #endif
74
75 #ifndef CGD3D8ENTRY
76 # ifdef _WIN32
77 # define CGD3D8ENTRY __cdecl
78 # else
79 # define CGD3D8ENTRY
80 # endif
81 #endif
82
83 enum cgD3D8Errors
84 {
85 cgD3D8Failed = 1000,
86 cgD3D8DebugTrace = 1001
87 };
88
89 /*---------------------------------------------------------------------------
90 // HRESULTs specific to cgD3D8. When the CGerror is set to cgD3D8Failed
91 // cgD3D8GetLastError will return an HRESULT that could be one these.
92 // Use cgD3D8TranslateHRESULT() to translate these errors into strings.
93 ---------------------------------------------------------------------------*/
94
95 static const HRESULT CGD3D8ERR_NOTLOADED = MAKE_HRESULT(1, 0x877, 1);
96 static const HRESULT CGD3D8ERR_NODEVICE = MAKE_HRESULT(1, 0x877, 2);
97 static const HRESULT CGD3D8ERR_NOTSAMPLER = MAKE_HRESULT(1, 0x877, 3);
98 static const HRESULT CGD3D8ERR_INVALIDPROFILE = MAKE_HRESULT(1, 0x877, 4);
99 static const HRESULT CGD3D8ERR_NULLVALUE = MAKE_HRESULT(1, 0x877, 5);
100 static const HRESULT CGD3D8ERR_OUTOFRANGE = MAKE_HRESULT(1, 0x877, 6);
101 static const HRESULT CGD3D8ERR_NOTUNIFORM = MAKE_HRESULT(1, 0x877, 7);
102 static const HRESULT CGD3D8ERR_NOTMATRIX = MAKE_HRESULT(1, 0x877, 8);
103 static const HRESULT CGD3D8ERR_INVALIDPARAM = MAKE_HRESULT(1, 0x877, 9);
104
105 static const HRESULT CGD3D8ERR_INVALIDSAMPLERSTATE = MAKE_HRESULT(1, 0x877, 100);
106 static const HRESULT CGD3D8ERR_INVALIDVEREXDECL = MAKE_HRESULT(1, 0x877, 101);
107
108 /*---------------------------------------------------------------------------
109 // Other error return values
110 ---------------------------------------------------------------------------*/
111
112 static const DWORD CGD3D8_INVALID_REG = 0xFFFFFFFF;
113
114 #ifdef __cplusplus
115 extern "C"
116 {
117 #endif
118
119 CGD3D8DLL_API DWORD CGD3D8ENTRY cgD3D8TypeToSize(CGtype type);
120 CGD3D8DLL_API DWORD CGD3D8ENTRY cgD3D8ResourceToInputRegister(CGresource resource);
121 CGD3D8DLL_API CGbool CGD3D8ENTRY cgD3D8GetVertexDeclaration(CGprogram prog, DWORD decl[MAX_FVF_DECL_SIZE]);
122 CGD3D8DLL_API CGbool CGD3D8ENTRY cgD3D8ValidateVertexDeclaration(CGprogram prog, const DWORD *decl);
123 CGD3D8DLL_API IDirect3DDevice8 * CGD3D8ENTRY cgD3D8GetDevice(void);
124 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8SetDevice(IDirect3DDevice8 *pDevice);
125 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8LoadProgram(CGprogram prog, CGbool paramShadowing, DWORD assemFlags, DWORD vshaderUsage, const DWORD *vertexDecl);
126 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8UnloadProgram(CGprogram prog);
127 CGD3D8DLL_API CGbool CGD3D8ENTRY cgD3D8IsProgramLoaded(CGprogram prog);
128 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8BindProgram(CGprogram prog);
129 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8SetUniform(CGparameter param, const void *floats);
130 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8SetUniformArray(CGparameter param, DWORD offset, DWORD numItems, const void *values);
131 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8SetUniformMatrix(CGparameter param, const D3DMATRIX *matrix);
132 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8SetUniformMatrixArray(CGparameter param, DWORD offset, DWORD numItems, const D3DMATRIX *matrices);
133 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8SetTexture(CGparameter param, IDirect3DBaseTexture8 *tex);
134 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8SetTextureStageState(CGparameter param, D3DTEXTURESTAGESTATETYPE type, DWORD value);
135 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8SetTextureWrapMode(CGparameter param, DWORD value);
136 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8EnableParameterShadowing(CGprogram prog, CGbool enable);
137 CGD3D8DLL_API CGbool CGD3D8ENTRY cgD3D8IsParameterShadowingEnabled(CGprogram prog);
138 CGD3D8DLL_API CGprofile CGD3D8ENTRY cgD3D8GetLatestVertexProfile(void);
139 CGD3D8DLL_API CGprofile CGD3D8ENTRY cgD3D8GetLatestPixelProfile(void);
140 CGD3D8DLL_API const char * CGD3D8ENTRY cgD3D8GetOptimalOptions(CGprofile profile);
141 CGD3D8DLL_API HRESULT CGD3D8ENTRY cgD3D8GetLastError(void);
142 CGD3D8DLL_API const char * CGD3D8ENTRY cgD3D8TranslateCGerror(CGerror error);
143 CGD3D8DLL_API const char * CGD3D8ENTRY cgD3D8TranslateHRESULT(HRESULT hr);
144 CGD3D8DLL_API void CGD3D8ENTRY cgD3D8EnableDebugTracing(CGbool enable);
145
146 #ifdef __cplusplus
147 }
148 #endif
149
150 #endif /* _WIN32 */
151
152 #endif

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.22