First, that should raise a non method error for nil, as CREATEDEV_FUNC has never been initialized.
Second, it seems that createDevice takes 7 arguments, and you are only using six integers. The arguments that API takes are:
Code:
irr::createDevice (video::E_DRIVER_TYPE deviceType = video::EDT_SOFTWARE,
const core::dimension2d< u32 > & windowSize = (core::dimension2d< u32 >(640, 480)),
u32 bits = 16,
bool fullscreen = false,
bool stencilbuffer = false,
bool vsync = false,
IEventReceiver * receiver = 0
)
The first is an integer, the second is a class that seems to have two Uint32(Width and Height), and the others should work well with integers as argument type. If that's correct, it should be:
Code:
createDevice= Win32API.new('Irrlicht', 'createDevice', 'IPIIIII', 'I')
size = [800, 600].pack('LL')
device = createDevice.call(0, size, 32, 0, 0, 0, 0)
That may work, but maybe not. I haven't tested and I don't know how core::dimension2d< u32 > should be packed as it's a class.
how i can use a class function this is sample in c++
Code:
driverType = video::EDT_OPENGL;
IrrlichtDevice *device = createDevice(driverType, core::dimension2d<u32>(640, 480));
video::IVideoDriver* driver = device->getVideoDriver();
I must a use a device->getVideoDriver(); - how i can do it in ruby
b - u - m - p
b - u - m - p
If you know c++, you should create a DLL that uses Irrlicht externaly and call your DLL from ruby. Ruby Win32API is very limited, mainly because ruby hasn't pointers and that makes things complicated, specially for c++ classes.
can i give me a source code for this sample :) plz
I won't, but google may help you.
this source code isn't in google - i find ...