ShiVa3D
Access to native PB API in Shiva?
BlackBerry Tablet OS and BlackBerry 10Access to native PB API in Shiva?
by lcocea » 08 Jun 2012, 20:17
For testing purposes I built The Hunt demo game while choosing BlackBerry PlayBook OS 1.0 as the target platform (I temporarily reinstalled NDK 1.0 to this purpose; I will soon get a license to access the Authoring Tool 1.4 beta for Tablet OS 2.x compatibility). I was reassured to see that the game appears to install and launch successfuly on the PB. Obviously, the user controls are not exactly set up for a mobile device, which is to be expected. I wonder whether Shiva 3D includes:
(1) Support for BlackBerry Tablet OS native C++ API calls, to access the PB hardware;
(2) A common wrapper for sensor native APIs that are specific to each mobile platform;
(3) Tutorial(s) for creating touch screen controls (such as the ones in Modern Combat 2 Black Pegasus).
Thanks.
(1) Support for BlackBerry Tablet OS native C++ API calls, to access the PB hardware;
(2) A common wrapper for sensor native APIs that are specific to each mobile platform;
(3) Tutorial(s) for creating touch screen controls (such as the ones in Modern Combat 2 Black Pegasus).
Thanks.
Last edited by lcocea on 08 Jun 2012, 23:00, edited 1 time in total.
Editor 1.9.2 beta 4
UAT 1.4 beta 10
UAT 1.4 beta 10
Re: Access to native API in Shiva?
by dreamora » 08 Jun 2012, 20:37
1) Through plugins, sure.
2) If you mean accelerometer and touch then yes thats present
3) Look at the iOS examples, they work on any touch mobile platform
2) If you mean accelerometer and touch then yes thats present
3) Look at the iOS examples, they work on any touch mobile platform
I'm no stonetrip representative, just a happy board member like you 
If you find my portfolio interesting, feel free to contact me or follow my shares on my twitter stream or my game development blog
If you find my portfolio interesting, feel free to contact me or follow my shares on my twitter stream or my game development blog
Re: Access to native PB API in Shiva?
by lcocea » 09 Jun 2012, 17:27
As a happy owner of a basic license I started playing with Authoring Tool 1.4 beta. I successfully installed the iPhoneCamera and iPhoneCharacter demos on my PB. They both appear to run in portrait mode only -- is this because they were coded for the iPhone rather than the PB, and I assume the APIs for rotation detection are different? Thanks.
Editor 1.9.2 beta 4
UAT 1.4 beta 10
UAT 1.4 beta 10
Re: Access to native PB API in Shiva?
by peter » 09 Jun 2012, 19:48
One of the biggest Shiva feature is that it is cross-platform engine. So, most of implemented functions in Shiva will work on every platform which Shiva support.
It should help you:
http://www.stonetrip.com/developer/doc/api/application-kOptionViewportRotation
It should help you:
http://www.stonetrip.com/developer/doc/api/application-kOptionViewportRotation
- peter
- Senior Boarder

- Posts: 61
Re: Access to native PB API in Shiva?
by lcocea » 09 Jun 2012, 19:57
Thanks, Peter. But then why do the "iPhone demos" run in landscape mode in Shiva Editor and in portrait mode on my PB? The default display mode on the PB is landscape.
Editor 1.9.2 beta 4
UAT 1.4 beta 10
UAT 1.4 beta 10
Re: Access to native PB API in Shiva?
by peter » 09 Jun 2012, 20:06
Maybe the problem is that the iphone has different default mode than playbook?
iphone -> portrait
playbook -> landscape
So if you rotate them by 90, you've got again different modes.
//edit:
So you must check on which platform program is running and then run specified mode.
or...
you can check height and width of screen and compare them. If width>height it means that you're starting your app in landscape mode, and analogously. Then you can rotate or no if you want.
iphone -> portrait
playbook -> landscape
So if you rotate them by 90, you've got again different modes.
//edit:
So you must check on which platform program is running and then run specified mode.
or...
you can check height and width of screen and compare them. If width>height it means that you're starting your app in landscape mode, and analogously. Then you can rotate or no if you want.
- peter
- Senior Boarder

- Posts: 61
Re: Access to native PB API in Shiva?
by lcocea » 09 Jun 2012, 20:14
You may be right. However, I doubt these particular demo apps were supposed to run in portrait mode on the iPhone as half the objects in the scene are not shown in this mode and controls are very crowded. Anyway, I hope I will figure it out along the way. Cheers!
// re: edit
Yes, that's how I check & set the orientation in my WebWorks apps. I am a beginner in ShiVa though...
// re: edit
Yes, that's how I check & set the orientation in my WebWorks apps. I am a beginner in ShiVa though...
Editor 1.9.2 beta 4
UAT 1.4 beta 10
UAT 1.4 beta 10
Re: Access to native PB API in Shiva?
by peter » 09 Jun 2012, 20:36
Unfortunately it not always easy to make apps look good (and playable) in both modes together.
I'm using this method (comparing width and height) in my game created in Shiva which I want to run only in portrait mode on pb, and it works well.
In turn, I'm beginner in Webworks and Native SDK.
btw. bb10 seems to be nice platform.
I'm using this method (comparing width and height) in my game created in Shiva which I want to run only in portrait mode on pb, and it works well.
In turn, I'm beginner in Webworks and Native SDK.
btw. bb10 seems to be nice platform.
- peter
- Senior Boarder

- Posts: 61
Re: Access to native PB API in Shiva?
by lcocea » 10 Jun 2012, 17:59
// update
Surprisingly, the iPhone demos do display on the PB in landscape mode but only if launched in portrait mode. Go figure...
Surprisingly, the iPhone demos do display on the PB in landscape mode but only if launched in portrait mode. Go figure...
Editor 1.9.2 beta 4
UAT 1.4 beta 10
UAT 1.4 beta 10
Re: Access to native PB API in Shiva?
by peter » 10 Jun 2012, 18:05
PB's "default" rotation is based on device orientation when you start app. I've solved this problem by checking width and height of screen.
Good luck
Good luck
- peter
- Senior Boarder

- Posts: 61
Re: Access to native PB API in Shiva?
by dreamora » 11 Jun 2012, 16:14
If I recall right, the constants for the rotation are exactly vice versa on PB vs iOS
I'm no stonetrip representative, just a happy board member like you 
If you find my portfolio interesting, feel free to contact me or follow my shares on my twitter stream or my game development blog
If you find my portfolio interesting, feel free to contact me or follow my shares on my twitter stream or my game development blog
11 posts
• Page 1 of 1

