Menu

[327ada]: / Source / Tests / Explorer / FXShader.cpp  Maximize  Restore  History

Download this file

44 lines (37 with data), 1.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <cstdio>
#include "FXShader.h"
#include "Scene.h"
#include "Console.h"
FXShader::FXShader(const char* name) : FXHandle(name) {
Get(name);
Reset();
}
FXShader::~FXShader() {
}
void FXShader::Get(const char* name) {
handle = FX->GetTechniqueByName(name);
if(!handle) { // Gebruik geen UI, want die hangt van het slagen van ons af...
char buffer[512];
snprintf(buffer,512,"Error creating D3DXHANDLE of shader %s\r\n",name);
MessageBox(hwnd,buffer,"Error",MB_ICONERROR);
}
}
void FXShader::Reset() {
if(scene) {
begin = scene->objects->begin(); // random value
} else {
begin = nulldummy;
}
end = begin; // end == begin means unused
unused = true;
}
void FXShader::Print() {
console->WriteVar("name",name);
console->WriteVar("handle",handle);
// console->WriteVar("nulldummy",nulldummy);
if(!unused) {
console->WriteVar("(*begin)->name",(*begin)->GetName());
console->WriteVar("(*end)->name)",(*end)->GetName());
}
console->WriteVar("unused",unused);
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.