Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
shdhwshader.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19 /***********************************************************************************************
20 *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
21 ***********************************************************************************************
22 * *
23 * Project Name : WW3D *
24 * *
25 * $Archive:: /Commando/Code/ww3d2/shdhwshader.h $*
26 * *
27 * $Org Author:: Kenny_m
28 * *
29 * $Author:: Kenny_m
30 *
31 * $Modtime:: 07/07/02 11:18p $*
32 * *
33 * $Revision:: 3 $*
34 * *
35 * 06/06/02 KM added software vertex shader fallback check
36 * 07/07/02 KM Generic shader functions for factoring HW shader code
37 *---------------------------------------------------------------------------------------------*
38 * Functions: *
39 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
40
41#ifndef SHDHWSHADER_H
42#define SHDHWSHADER_H
43
44#ifndef _D3D8_H_
45#include <d3d8.h>
46#endif
47
48#ifndef __D3DX8_H__
49#include <d3dx8.h>
50#endif
51
52#ifndef SHDHW_CONSTANTS_H
53#include "shdhw_constants.h"
54#endif
55
56
57class RenderInfoClass;
58class Vector4;
59
61{
62public:
64 virtual ~ShdHWShader() {}
65
66 DWORD Peek_Shader() const { return Shader; }
67
68protected:
69
70 void Shell_Run(char* cmd);
71
73 (
74 char* file_name,
75 LPD3DXBUFFER* constants,
76 LPD3DXBUFFER* shader_code
77 );
78
80};
81
83{
84public:
85 virtual ~ShdHWVertexShader();
86
88 (
89 char* file_name,
90 DWORD* vertex_shader_declaration
91 );
92
94 (
95 DWORD* shader_code,
96 DWORD* vertex_shader_declaration
97 );
98
99 void Destroy();
100
101 static bool Is_Using_Hardware() { return Using_Hardware; }
102
103 static void Light
104 (
105 RenderInfoClass& rinfo,
106 Vector4& ambient,
107 Vector4& diffuse,
108 Vector4& specular
109 );
110
111 static void Light
112 (
113 RenderInfoClass& rinfo,
114 Vector4& ambient,
115 Vector4& diffuse
116 );
117
118private:
119 static bool Using_Hardware;
120};
121
123{
124public:
125 virtual ~ShdHWPixelShader();
126
127 DWORD Create(char* file_name);
128 DWORD Create(DWORD* shader_code);
129
130 void Destroy();
131};
132
133#endif
unsigned long DWORD
Definition bittype.h:57
DWORD Create(char *file_name)
Create Pixel Shader from a file.
void Destroy()
Destroy this pixel shader.
virtual ~ShdHWPixelShader()
Destruct this pixel shader.
virtual ~ShdHWShader()
Definition shdhwshader.h:64
DWORD Peek_Shader() const
Definition shdhwshader.h:66
void Shell_Run(char *cmd)
Execute and wait for a hidden shell command.
void Preprocess_And_Assemble_Shader_From_File(char *file_name, LPD3DXBUFFER *constants, LPD3DXBUFFER *shader_code)
Preprocess and assemble a HW shader from file.
virtual ~ShdHWVertexShader()
Destruct this vertex shader.
DWORD Create(char *file_name, DWORD *vertex_shader_declaration)
Create Vertex Shader from a file and vertex stream declaration.
void Destroy()
Destroy this vertex shader.
static void Light(RenderInfoClass &rinfo, Vector4 &ambient, Vector4 &diffuse, Vector4 &specular)
Apply generic lighting.
static bool Is_Using_Hardware()