Permalink
Browse files

update NDK-Samples for BB 10.0.06

  • Loading branch information...
1 parent f369991 commit 93b8b8efd0cd6ac7b51c8e113be6b8ea85b815dc @jhoffmannrim jhoffmannrim committed Jun 27, 2012
Showing with 279 additions and 209 deletions.
  1. +1 −1 Accelerometer/bar-descriptor.xml
  2. +1 −1 AudioControl/bar-descriptor.xml
  3. +1 −1 Channels/bar-descriptor.xml
  4. +1 −1 CubeRotate/bar-descriptor.xml
  5. +0 −1 CubeRotate/bbutil.c
  6. +12 −5 CubeRotate/main.c
  7. +1 −1 Dialog/bar-descriptor.xml
  8. +1 −1 FallingBlocks/bar-descriptor.xml
  9. +0 −1 FallingBlocks/bbutil.c
  10. +4 −5 FallingBlocks/main.c
  11. +0 −1 GLES11Template/bbutil.c
  12. +4 −4 GLES11Template/main.c
  13. +0 −1 GLES20Template/bbutil.c
  14. +4 −4 GLES20Template/main.c
  15. +1 −1 Geolocation/bar-descriptor.xml
  16. +1 −1 Gesture/bar-descriptor.xml
  17. +9 −8 Gesture/main.c
  18. BIN GoodCitizen/background-landscape.png
  19. BIN GoodCitizen/background-portrait.png
  20. +3 −2 GoodCitizen/bar-descriptor.xml
  21. +0 −1 GoodCitizen/bbutil.c
  22. +110 −56 GoodCitizen/main.c
  23. BIN GoodCitizen/shadow.png
  24. +1 −1 HelloWorldConsole/bar-descriptor.xml
  25. +1 −1 HelloWorldDisplay/bar-descriptor.xml
  26. +0 −1 HelloWorldDisplay/bbutil.c
  27. +23 −16 HelloWorldDisplay/main.c
  28. +1 −1 HttpProxy/bar-descriptor.xml
  29. +1 −1 Keyboard/bar-descriptor.xml
  30. +0 −1 Keyboard/bbutil.c
  31. +5 −5 Keyboard/main.c
  32. +1 −1 LocaleSample/bar-descriptor.xml
  33. +1 −1 NetworkStatus/bar-descriptor.xml
  34. +1 −1 PaymentService/bar-descriptor.xml
  35. +1 −1 PlayAudio/bar-descriptor.xml
  36. +7 −1 PlayAudio/{dialogutil.c → dialogaudio.c}
  37. 0 PlayAudio/{dialogutil.h → dialogaudio.h}
  38. +73 −54 PlayAudio/main.c
  39. +1 −1 PlayAudio/manifest.properties
  40. +1 −1 PlayWav/bar-descriptor.xml
  41. +5 −4 ScreenTemplate/main.c
  42. +1 −1 VideoPlayback/bar-descriptor.xml
  43. +1 −1 VideoWindow/bar-descriptor.xml
  44. +0 −18 VideoWindow/main.c
@@ -35,7 +35,7 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
- <splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
+ <splashScreens>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashScreens>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
@@ -35,7 +35,7 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
- <splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
+ <splashScreens>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashScreens>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
@@ -35,7 +35,7 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
- <splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
+ <splashScreens>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashScreens>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
@@ -35,7 +35,7 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
- <splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
+ <splashScreens>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashScreens>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
View
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <assert.h>
#include <ctype.h>
#include <unistd.h>
#include <stdio.h>
View
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <assert.h>
#include <screen/screen.h>
#include <bps/navigator.h>
#include <bps/screen.h>
@@ -118,7 +117,15 @@ int initialize()
float xMax = yMax *aspect;
glFrustumf(xMin, xMax, -yMax, yMax, nearClip, farClip);
- glScalef((float)surface_height/(float)surface_width, 1.0f, 1.0f);
+
+ if (surface_width > surface_height)
+ {
+ glScalef((float)surface_height/(float)surface_width, 1.0, 1.0f);
+ }
+ else
+ {
+ glScalef(1.0, (float)surface_width/(float)surface_height, 1.0f);
+ }
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@@ -149,7 +156,6 @@ void render()
}
int main(int argc, char *argv[]) {
- int rc;
int exit_application = 0;
static screen_context_t screen_cxt;
@@ -201,8 +207,9 @@ int main(int argc, char *argv[]) {
while (!exit_application) {
//Request and process BPS next available event
bps_event_t *event = NULL;
- rc = bps_get_event(&event, 0);
- assert(rc == BPS_SUCCESS);
+ if (BPS_SUCCESS != bps_get_event(&event, 0)) {
+ fprintf(stderr, "bps_get_event() failed\n");
+ }
if (event) {
int domain = bps_event_get_domain(event);
@@ -35,7 +35,7 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
- <splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
+ <splashScreens>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashScreens>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
@@ -35,7 +35,7 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
- <splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
+ <splashScreens>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashScreens>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
View
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <assert.h>
#include <ctype.h>
#include <unistd.h>
#include <stdio.h>
View
@@ -21,7 +21,6 @@
#include <string.h>
#include <sys/keycodes.h>
#include <screen/screen.h>
-#include <assert.h>
#include <bps/sensor.h>
#include <bps/navigator.h>
#include <bps/screen.h>
@@ -367,13 +366,13 @@ static void handle_events() {
int navigator_domain = navigator_get_domain();
int sensor_domain = sensor_get_domain();
- int rc;
-
//Request and process available BPS events
for(;;) {
bps_event_t *event = NULL;
- rc = bps_get_event(&event, 0);
- assert(rc == BPS_SUCCESS);
+ if (BPS_SUCCESS != bps_get_event(&event, 0)) {
+ fprintf(stderr, "bps_get_event failed\n");
+ return;
+ }
if (event) {
int domain = bps_event_get_domain(event);
View
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <assert.h>
#include <ctype.h>
#include <unistd.h>
#include <stdio.h>
View
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <assert.h>
#include <screen/screen.h>
#include <bps/navigator.h>
#include <bps/screen.h>
@@ -137,7 +136,6 @@ void render() {
}
int main(int argc, char *argv[]) {
- int rc;
int exit_application = 0;
static screen_context_t screen_cxt;
@@ -191,8 +189,10 @@ int main(int argc, char *argv[]) {
bps_event_t *event = NULL;
for(;;) {
- rc = bps_get_event(&event, 0);
- assert(rc == BPS_SUCCESS);
+ if (BPS_SUCCESS != bps_get_event(&event, 0)) {
+ fprintf(stderr, "bps_get_event failed\n");
+ break;
+ }
if (event) {
int domain = bps_event_get_domain(event);
View
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <assert.h>
#include <ctype.h>
#include <unistd.h>
#include <stdio.h>
View
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <assert.h>
#include <screen/screen.h>
#include <bps/navigator.h>
#include <bps/screen.h>
@@ -275,7 +274,6 @@ void render() {
}
int main(int argc, char *argv[]) {
- int rc;
int exit_application = 0;
//Create a screen context that will be used to create an EGL surface to to receive libscreen events
@@ -332,8 +330,10 @@ int main(int argc, char *argv[]) {
bps_event_t *event = NULL;
for(;;) {
- rc = bps_get_event(&event, 0);
- assert(rc == BPS_SUCCESS);
+ if (BPS_SUCCESS != bps_get_event(&event, 0)) {
+ fprintf(stderr, "bps_get_event failed\n");
+ break;
+ }
if (event) {
int domain = bps_event_get_domain(event);
@@ -35,7 +35,7 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
- <splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
+ <splashScreens>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashScreens>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
@@ -35,7 +35,7 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
- <splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
+ <splashScreens>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashScreens>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
View
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-#include <assert.h>
#include <bps/bps.h>
#include <bps/event.h>
#include <bps/navigator.h>
#include <bps/screen.h>
+#include <errno.h>
#include <fcntl.h>
#include <img/img.h>
#include <math.h>
@@ -128,12 +128,10 @@ gesture_callback(gesture_base_t* gesture, mtouch_event_t* event, void* param, in
static void
init_gestures()
{
- gesture_tap_t* tap;
- gesture_double_tap_t* double_tap;
set = gestures_set_alloc();
if (NULL != set) {
- tap = tap_gesture_alloc(NULL, gesture_callback, set);
- double_tap = double_tap_gesture_alloc(NULL, gesture_callback, set);
+ tap_gesture_alloc(NULL, gesture_callback, set);
+ double_tap_gesture_alloc(NULL, gesture_callback, set);
tfpan_gesture_alloc(NULL, gesture_callback, set);
pinch_gesture_alloc(NULL, gesture_callback, set);
} else {
@@ -196,13 +194,16 @@ handle_navigator_event(bps_event_t *event) {
static void
handle_events()
{
- int rc, domain;
+ int domain;
bool has_events = true;
while(has_events) {
bps_event_t *event = NULL;
- rc = bps_get_event(&event, 50);
- assert(rc == BPS_SUCCESS);
+ if (BPS_SUCCESS != bps_get_event(&event, 50)) {
+ has_events = false;
+ continue;
+ }
+
if (event) {
domain = bps_event_get_domain(event);
if (domain == navigator_get_domain()) {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -35,7 +35,7 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
- <splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
+ <splashScreens>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashScreens>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
@@ -53,9 +53,10 @@
<asset path="sample-splashscreen-portrait.png">sample-splashscreen-portrait.png</asset>
<asset path="radio_btn_selected.png">radio_btn_selected.png</asset>
<asset path="radio_btn_unselected.png">radio_btn_unselected.png</asset>
- <asset path="shadow.png">shadow.png</asset>
<asset path="LICENSE">LICENSE</asset>
<asset path="NOTICE">NOTICE</asset>
+ <asset path="background-landscape.png">background-landscape.png</asset>
+ <asset path="background-portrait.png">background-portrait.png</asset>
<configuration id="com.qnx.qcc.toolChain.418523391" name="Default">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="arm/o.le-v7-g/GoodCitizen" entry="true" type="Qnx/Elf">GoodCitizen</asset>
View
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <assert.h>
#include <ctype.h>
#include <unistd.h>
#include <stdio.h>
Oops, something went wrong.

0 comments on commit 93b8b8e

Please sign in to comment.