Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
Harteex
Posts: 3
Registered: ‎02-16-2012
My Device: None yet
Accepted Solution

Problems getting SDL to work

Hi

 

First, what I'm running:

* NDK 2 QNX Momentics IDE

* Simulator

 

I've been struggling for a while to get SDL to work.

I've finally been able to compile SDL and TouchControlOverlay, then create a new project depending on those, and then build it all. However my simple app does not work on the simulator, it just freezes with a white screen.

 

I added the shared libraries of SDL and TouchControlOverlay as assets in the bar-descriptor file, not sure if that was the right thing to do.

 

When I don't have anything SDL in the main.c file, but just a printf, I can see that without problems and the app of course exits immediately as it should. However, if I add an SDL init function, it doesn't even print the printf which is above it...

 

Here's my build log:

**** Rebuild of configuration Simulator-Debug for project SameGooSDL ****

**** Internal Builder is used for build               ****
qcc -o src\main.o ..\src\main.c -V4.4.2,gcc_ntox86 -w1 -IC:/Program2/bbndk-2.0.0-beta3/target/qnx6/usr/include/freetype2 -IC:/Program2/bbndk-2.0.0-beta3/target/qnx6/../target-override/usr/include -IC:\Users\Harteex\Documents\bbndk2-workspace\SDL12\include -D_FORTIFY_SOURCE=2 -c -O0 -g -fstack-protector-all
qcc -o SameGooSDL src\main.o -lbps -lscreen -lm -lpng -lasound -lSDL12 -lTouchControlOverlay -lxml2 -lGLESv2 -V4.4.2,gcc_ntox86 -w1 -g -Wl,-z,relro -Wl,-z,now -LC:/Program2/bbndk-2.0.0-beta3/target/qnx6/../target-override/x86/lib -LC:/Program2/bbndk-2.0.0-beta3/target/qnx6/../target-override/x86/usr/lib -LC:\Users\Harteex\Documents\bbndk2-workspace\SDL12\Simulator -LC:\Users\Harteex\Documents\bbndk2-workspace\TouchControlOverlay\Simulator
Build complete for project SameGooSDL
Time consumed: 310  ms.  

 

Does anyone know how I can get an app with SDL running?

Alternatively, does anyone have an empty SDL project for the NDK 2 (Momentics IDE) that I could try?

Please use plain text.
Retired
fernando_simoes
Posts: 25
Registered: ‎01-30-2012
My Device: Bold 9900

Re: Problems getting SDL to work

Hello Harteex,

 

Have you considered giving it a try at our port of SDL and TCO at github? 

 

https://github.com/blackberry/SDL

https://github.com/blackberry/TouchControlOverlay




Please use plain text.
New Contributor
Harteex
Posts: 3
Registered: ‎02-16-2012
My Device: None yet

Re: Problems getting SDL to work

I am using that SDL port and TCO already. They seem to compile fine.

The problem is I'm having trouble creating a working project which is based on those two.

I would love to see a project pre-configured which I could import and run, to see what I'm doing wrong.

Please use plain text.
Retired
fernando_simoes
Posts: 25
Registered: ‎01-30-2012
My Device: Bold 9900

Re: Problems getting SDL to work

Thanks Harteex. That is definitely a good idea; I'll reach our folks on github and see if we can expedite one to simplify the process.

 

Feel free to contact me via PM anytime if you need a close follow-up.

 

Please use plain text.
Retired
fernando_simoes
Posts: 25
Registered: ‎01-30-2012
My Device: Bold 9900

Re: Problems getting SDL to work

Harteex,

 

Here you go! The team that did the port of SDL (they were very helpful) jumped in and we could together put a quick SDL-contained zipped project for you.

 

I tested it on both the hardware and simulator in my lab and runs well. Let me know if you have any issue.

 

 

Please use plain text.
New Contributor
Harteex
Posts: 3
Registered: ‎02-16-2012
My Device: None yet

Re: Problems getting SDL to work

It works, thanks!

Only one issue I had to fix, the include paths in the project points to an absolute position in C:\cygwin with your nick in the path, so I had to change that first.

 

It's probably a good idea to put this at your SDL github repository, or on the samples pages for the native SDK so others also can get started more easily.

Please use plain text.
Retired
fernando_simoes
Posts: 25
Registered: ‎01-30-2012
My Device: Bold 9900

Re: Problems getting SDL to work

You're welcome, I'm glad it helped. I didn't clean it up much, but I really didn't want to let you stuck with this. In the near future some more polished will be available at github.

 

Good luck on your project!

Please use plain text.
New Developer
Vilmos
Posts: 10
Registered: ‎02-29-2012
My Device: PlayBook Developer

Re: Problems getting SDL to work

I'd also like to thank you for the SDL port and skeletion program, that helped setup a lot.

 

I'm having trouble on the simulator now, the sample runs in 640x480 but it I try to change that to native resolution on the PlayBook of 1024x600 the screen setup fails.

 

I can find 640x480, 800x600 and 1024x600 in the video driver for the playbook and it should work but I can't seem to get it to work except at the lowest.  What am I doing wrong?

Please use plain text.