[IOS] 'irrlicht_main' instead of standard 'main'?

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
galf
Posts: 10
Joined: Sun Nov 08, 2015 8:24 am

[IOS] 'irrlicht_main' instead of standard 'main'?

Post by galf »

Hi,

Environment: ios, xcode 6.2,ipad model: ME814HB/A , ios: 8.1.2

I ran the example code of ios and managed to make it work correctly.

now I want to create a device of irrlicht within my framework the same way I did in windows:

Code: Select all

 
irr::SIrrlichtCreationParameters params;
    
params.DriverType = irr::video::EDT_OGLES1;
params.WindowId   = view;
params.Bits       = 16;
params.Fullscreen = false;
params.Stencilbuffer = false;
params.Vsync = false;
    
irr::IrrlichtDevice* device = createDeviceEx((const irr::SIrrlichtCreationParameters)params);
 
but irrlicht's invokes linkedge problem : I haven't implemented irrlicht_main.
What I want to do is to run my own main and give irrlicht a handle to the view (like in windows).
so I did this :

Code: Select all

 
void irrlicht_main()
{
    NSLog(@"Not Suppose to enter here ");
}
 
int main(int argc, char * argv[])
{
    @autoreleasepool {
        int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
        return retVal;
    }
}
 


problems:

1) it did not solved my linkedge problem
2) I fear I'm doing something wrong. from the source code of irrlicht it seems that it's taking over all the ios app,
and in my implemetation i want that irrlicht will manage only one view. Is there a way To do what I want?

Thanks
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [IOS] 'irrlicht_main' instead of standard 'main'?

Post by CuteAlien »

At the moment there is a main() function inside Irrlicht for iOS so you can't have your own. Nadro and me have started discussing just this point last week. No solution yet (still under discussion...).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
galf
Posts: 10
Joined: Sun Nov 08, 2015 8:24 am

Re: [IOS] 'irrlicht_main' instead of standard 'main'?

Post by galf »

Thanks for the reply. I'm looking forward for this implementation...

About my linkedge problem:I found that If
I Implement my irrlicht_main() inside a .mm file (objective-c++ file)
it removes my linkedge problem (I guess my problem was the objective-c compiler).
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: [IOS] 'irrlicht_main' instead of standard 'main'?

Post by Nadro »

Hi,

Please check an example no. 28. In the latest ogl-es branch you don't need own UIApplicationMain, UIApplicationDelegate etc. At now You can use Irrlicht on iOS like on the other systems, just replace 'int main()' by 'void irrlicht_main()'. In upcoming commits I'll add support for receive application delegate events like a applicationDidBecomeActive, applicationWillResignActive, applicationWillTerminate etc. via IEventReceiver. If you need custom UIApplicationDelegate you must wait a bit, I'll add support for this feature later.

Cheers,
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
umen
Posts: 54
Joined: Fri Aug 08, 2008 11:10 am

Re: [IOS] 'irrlicht_main' instead of standard 'main'?

Post by umen »

I try to compile the helloWorld_IOS using xcode Version 7.2 (7C68)
just loading the BuildAllExamples.xcworkspace
and getting this error:

Code: Select all

ld: warning: directory not found for option '-L/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX'
Undefined symbols for architecture x86_64:
  "irr::CIrrDeviceMacOSX::CIrrDeviceMacOSX(irr::SIrrlichtCreationParameters const&)", referenced from:
      _createDeviceEx in libIrrlicht.a(Irrlicht.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: [IOS] 'irrlicht_main' instead of standard 'main'?

Post by Nadro »

I'll fix it tomorrow. Thanks for a report.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: [IOS] 'irrlicht_main' instead of standard 'main'?

Post by Nadro »

OSX examples has unnecessary entry and I'll remove it:
/Users/patryk/Programowanie/irrlicht-ogles/
however building works fine (I tested it on different Macs) for OSX example and iOS. Do you use a proper target?
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
AndySenHu
Posts: 5
Joined: Fri Nov 25, 2016 3:53 am

Re: [IOS] 'irrlicht_main' instead of standard 'main'?

Post by AndySenHu »

I try to compile the helloWorld on Mac OS 10.11 using Xcode Version 8.0, but getting this error:

Undefined symbols for architecture x86_64:
"irr::CIrrDeviceMacOSX::CIrrDeviceMacOSX(irr::SIrrlichtCreationParameters const&)", referenced from:
_createDeviceEx in libIrrlicht.a(Irrlicht.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Post Reply