problem to use XEffects

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
diogoecomp
Posts: 30
Joined: Thu Jun 11, 2009 3:36 am

problem to use XEffects

Post by diogoecomp »

I need some help of you guys. I'm trying to use the XEffects but my code simply don't compile. These are the configurations:

Code: Select all

#include <irrlicht.h>
#include <iostream>
#include <XEffects.h>

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "Irrlicht.lib")
#endif

using namespace irr;
using namespace scene;
using namespace video;
using namespace core;
using namespace std;
The XEffects.h is included as a header file. The CShaderPre.cpp and the EffectHandler.cpp are included as resource files. And these are some of the errors that I have:
-> effecthandler.h(191) : error C2039: 'dimension2du' : is not a member of 'irr::core'
-> effectcb.h(105) : error C2065: 'currentRTTSize' : undeclared identifier

I'm using VS2008, Irrlicht 1.5 and XEffects 1.3.

thanks.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

It looks like the version of XEffects you are using is intended to be used with Irrlicht 1.6 or later. It uses the type dimension2du. If this is the only problem, it shouldn't be to much trouble to fix. You should just add the following typedef near the bottom of dimension2d.h...

Code: Select all

typedef dimension2d<u32> dimension2du;
Another thing to think about. Don't pull all namespaces you use into the global namespace with using namespace .... If you do this, you'll get name collisions. As you have it above, trying to use the type string will likely result in compile errors.

Travis
diogoecomp
Posts: 30
Joined: Thu Jun 11, 2009 3:36 am

Post by diogoecomp »

thanks Travis!
using that line that you mentioned I still have this error:

Code: Select all

error C2664: 'EffectHandler::EffectHandler(irr::IrrlichtDevice *,const irr::core::dimension2du &,const bool,const bool,const bool)' : cannot convert parameter 2 from 'const irr::core::dimension2d<T>' to 'const irr::core::dimension2du &'
1>        with
1>        [
1>            T=irr::s32
1>        ]
1>        Reason: cannot convert from 'const irr::core::dimension2d<T>' to 'const irr::core::dimension2du'
1>        with
1>        [
1>            T=irr::s32
1>        ]
1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
When I use Irrlicht 1.6 there is no errors to compile but I get a totally black screen, like if there is no lights at all. I've followed all the steps from the example code from XEffects. Is there any stupid solution to this that I didn't see? :roll:
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

It looks like you're still passing a dimension2d<s32>. You need to change whatever you're passing to dimension2d<u32>
diogoecomp
Posts: 30
Joined: Thu Jun 11, 2009 3:36 am

Post by diogoecomp »

Lonesome Ducky,
sorry if I wasn't so clear. The problem that I want to solve now is the one related to the black screen and XEffects. My code is using Irrlicht 1.6 now, so that s32/u32 problem is not a problem anymore :)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Well it's not easy to know what's going wrong without some kind of clue. You probably have incorrect near/far values.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply