draw2DImage issue

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
Cristian
Posts: 55
Joined: Fri Nov 25, 2005 12:02 pm

draw2DImage issue

Post by Cristian »

I'm really having a problem with

IVideoDriver

Code: Select all

m_pDriver->draw2DImage(windowskin, rect<s32>(x, y+6, x+6, tempY-6), irr::core::rect<irr::s32>(LT_LIN_ST_X, LT_LIN_ST_Y, LT_LIN_END_X, LT_LIN_END_Y), 0, wincolor, true);
I know that the method
virtual void irr::video::IVideoDriver::draw2DImage ( const video::ITexture * texture,
const core::rect< s32 > & destRect,
const core::rect< s32 > & sourceRect,
const core::rect< s32 > * clipRect = 0,
video::SColor * colors = 0,
bool useAlphaChannelOfTexture = false
)

is implemented in the engine (checked docs and source) but, then why do I get this error when compiling

c:\source\gui\cwindow.cpp(62) : error C2664: 'void irr::video::IVideoDriver::draw2DImage(const irr::video::ITexture *,const irr::core::position2d<T> &,const irr::core::rect<T> &,const irr::core::rect<T> *,irr::video::SColor,bool)' : cannot convert parameter 2 from 'irr::core::rect<T>' to 'const irr::core::position2d<T> &'
with
[
T=irr::s32
]
Reason: cannot convert from 'irr::core::rect<T>' to 'const irr::core::position2d<T>'
with
[
T=irr::s32
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

Oh,and I use MSVC 2005 express (MS C++ compiler 2005)
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: draw2DImage issue

Post by randomMesh »

I just had a look at the sources...*

Do you use the Softwaredriver or the BurningsVideodriver by any chance?
This method isn't implemented there.

Only in the OpenGL and DirectX drivers.


*Open source all the way, baby. Yeah!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

But there's a fallback in CNullDriver, otherwise the sources wouldn't compile. This is a problem with the colors parameter, because the mentioned method requires a pointer to an array with 4 colors.
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

hybrid wrote:But there's a fallback in CNullDriver

Code: Select all

//! Draws a part of the texture into the rectangle.
void CNullDriver::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
	const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
	video::SColor* colors, bool useAlphaChannelOfTexture)
{
}
Implemented, yes. Sorry. My mistake :).
But still... It's empty.
Cristian
Posts: 55
Joined: Fri Nov 25, 2005 12:02 pm

Post by Cristian »

@hybrid: Thanks, this was really dumb of me.:lol:
So, it's four colors, one for each point in the rect I guess... :D
Post Reply