Irrlicht software renderer

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.
compound
Posts: 18
Joined: Sun Feb 24, 2008 12:38 pm

Irrlicht software renderer

Post by compound »

hi im trying to use irrlicht using just the software capabilities on linux without using X, i cant seem to find how to get the examples to run using "/dev/fb0" as opposed to the pci device it tries to configure when running these apps. how can i specify to use just the framebuffer on /dev/fb0 ??/ or is this not possible?

many thanks


edit: here is the output of fbset -i if it is any help

mode "1688x964-60"
# D: 74.178 MHz, H: 33.717 kHz, V: 59.942 Hz
geometry 1688 964 1688 964 32
timings 13481 264 160 94 62 88 5
bcast true
laced true
rgba 8/16,8/8,8/0,8/24
endmode

Frame buffer device information:
Name : ps3fb
Address : 0x800000
Size : 18808832
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 0
YPanStep : 0
YWrapStep : 0
LineLength : 6784
Accelerator : No
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I can send you my FB device. Since I still had no time to figure proper event and input handling I did not yet commit it, but it's basically working. You can try the files under http://parsys.informatik.uni-oldenburg. ... device.zip
compound
Posts: 18
Joined: Sun Feb 24, 2008 12:38 pm

Post by compound »

thanks alot, ive just been playing around trying to get it to work with the hello world example. but as im new to this API im not entirely sure how i can integrate your driver with this example

i tried

#include <CIrrDeviceFB.h>

then tried to change the device to the CirrDeviceFB like so:

CIrrDeviceFB *device =
createDevice( video::EDT_SOFTWARE, dimension2d<s32>(640, 480), 16,
false, false, false, 0);

but i get the following error

main.cpp: In function int main():
main.cpp:112: error: CIrrDeviceFB was not declared in this scope
main.cpp:112: error: device was not declared in this scope


but i have included the cpp in the makefile so i assume that the function definition is included

Sources := main.cpp CIrrDeviceFB.cpp
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I haven't looked at the source, but it sounds like a namespace problem.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The files are also preprocessor define guearded, so you have to define _IRR_USE_FB_DEVICE_ to enable the code. Also make sure that the other devices are turned off, otherwise you'll get duplicated symbols. There's some additional code in the IrrCompileConfig.h that I made, but due to other changes I still have uncommited in my development version I cannot give you the actual code you'd need. Just try to play around with it and read the sources thoroughly.
compound
Posts: 18
Joined: Sun Feb 24, 2008 12:38 pm

Post by compound »

edit ignore me. ill keep trying, thanks
compound
Posts: 18
Joined: Sun Feb 24, 2008 12:38 pm

Post by compound »

ok i seem to have been able to get irrlicht compiled with the necessary modifications to the IrrCompileConfig.h file, now i just cant work out how to actually initialise the fb device seeing as all your functions are virtual, and create device returns a device of type irr::IrrlichtDevice.

sorry im trying not to be ignorant on all of this, but i really cant work out how to integrate your device. any more clues at all? thanks
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You just use createDevice or createDeviceEX, just as for the other devices. That's why you have to disable them.
The device will always use /dev/fb0. You can both software renderers, where burningsvideo will give the better quality and, with the proper settings, also pretty good FPS.
The input support is not working, at least I couldn't figure it out. But rendering works without problems.
compound
Posts: 18
Joined: Sun Feb 24, 2008 12:38 pm

Post by compound »

thanks. i seem to be getting nowhere with this, i must be doing something very wrong. no matter what i try i just cant seem to run any of the example apps using this

any idea when you think you will be commiting this driver? might be easier if i wait until i can get a package with it already linked in.
compound
Posts: 18
Joined: Sun Feb 24, 2008 12:38 pm

Post by compound »

OK i finally made progress, kind of hacked it a little bit, though, not sure if that is why im having this problem

the way i did it was replace both CIrrDeviceLinux files with CIrrDeviceFB, changing the name back to CIrrDeviceLinux though. this way at least everything compiles and runs
BUT I'm having some very strange problems with this the screen seems to be rendered diagonally across the screen several times. any idea what could be causing this?

Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, seems a problem with the color format of the FB, or the dimensions. I read and print the current configuration, compare the results with your actual configuration. Also try to change the values which are set. Maybe they are not supported by your device.
compound
Posts: 18
Joined: Sun Feb 24, 2008 12:38 pm

Post by compound »

my fb settings seem to be compliant with that of the application

root@localhost:/mnt/share/irrlicht/bin/Linux# fbset -s

mode "1688x964-60"
# D: 74.178 MHz, H: 33.717 kHz, V: 59.942 Hz
geometry 1688 964 1688 964 32
timings 13481 264 160 94 62 88 5
bcast true
laced true
rgba 8/16,8/8,8/0,8/24
endmode




the colour format in the driver is set to : video::ECF_A8R8G8B8

//! Default 32 bit color format. 8 bits are used for every component:
//! red, green, blue and alpha.
ECF_A8R8G8B8


with my device initialised like this

IrrlichtDevice *device =
createDevice( video::EDT_BURNINGSVIDEO, dimension2d<s32>(1688, 964), 32,
true, false, true, 0);

so all the values seem to corrispond with the frame buffers configuration

this is also the output of your driver


root@localhost:/mnt/share/irrlicht/bin/Linux# ./01.HelloWorld
Irrlicht Engine version 1.4
Linux 2.6.23-rc6-powerpc64-smp-custom #1 SMP Thu Sep 13 11:21:21 EDT 2007 ppc64
Read keyboard mode: Invalid argument
Set keyboard mode: Invalid argument
Original resolution: 1688 x 964
ARGB8888

New resolution: 1688 x 964 (1688 x 964)
ARGB8888

Loaded mesh: ../../media/sydney.md2
Loaded texture: ../../media/sydney.bmp
compound
Posts: 18
Joined: Sun Feb 24, 2008 12:38 pm

Post by compound »

fixed :) seemed to be a resolution issue, i set the default resolution to 720 X 480 and in the app and it seems to display really well. thanks alot!!

do you mind if i pass your files onto other people?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Try to check the Pitch value, maybe something's wrong there.
compound
Posts: 18
Joined: Sun Feb 24, 2008 12:38 pm

Post by compound »

sorry I don't know if you saw my previous post or not?

thanks for you help
Post Reply