Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 900 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Effect_load - Warning on Compiler Error #409433
10/17/12 12:13
10/17/12 12:13
Joined: Jul 2008
Posts: 894
T
TechMuc Offline OP
User
TechMuc  Offline OP
User
T

Joined: Jul 2008
Posts: 894
Hi,

Is there an easy way to avoid the message box when compiling effects via effect_load?
This is a pretty annoying message box for shader editors..

Or: Is there any way to validate an effect from string / file before loading via effect_load (of course DirectX Functions are also acceptable).

regards,
Timo

PS: My current method is to hook the function call of message box, and avoid the called message box. Though this ofc works, i would like to try to avoid any unnessasary hooking, so therefore it would be cool if you could give me a short D3DX Snippet you currently use to check the effects..

Last edited by TechMuc; 10/17/12 12:41.
Re: Effect_load - Warning on Compiler Error [Re: TechMuc] #409484
10/18/12 08:39
10/18/12 08:39
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
You can compile the effect for checking if there are syntax errors. Our code looks like this:

Code:
LPD3DXEFFECTCOMPILER pEffectCompiler = NULL;
LPD3DXBUFFER pEffect = NULL;
hr = D3DXCreateEffectCompiler(
	content,len,
	NULL,	// defines
	&includeManager,	// includes
	D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY,
	&pEffectCompiler,NULL);

if(SUCCEEDED(hr))
	hr = pEffectCompiler->CompileEffect(
		D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY,
		&pEffect,NULL);
if(!SUCCEEDED(hr) || !pEffect)
	... // show error box



"content" and "len" are the source code and its size.

Re: Effect_load - Warning on Compiler Error [Re: jcl] #409487
10/18/12 09:12
10/18/12 09:12
Joined: Jul 2008
Posts: 894
T
TechMuc Offline OP
User
TechMuc  Offline OP
User
T

Joined: Jul 2008
Posts: 894
thanks a lot for your help. The include Manager is currently not active as includes are not allowed in 3D-Gamestudio FX files. Is that correct?

Thanks again,
regards,
Timo

Re: Effect_load - Warning on Compiler Error [Re: TechMuc] #409496
10/18/12 12:09
10/18/12 12:09
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The include manager is heavily used by the shaders that come with Gamestudio. It just does not yet load external includes, but will support this in the next update.


Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1