So I downloaded flascc, and messed around with the sample.
sample 09 (threads) and sample 12 (stage3D) worked well by themselves, but when I tried to run threads in Stage3D sample, they were never started.
Here's a code I have in main()
pthread_t thread;
printf("Start a thread");
int val = pthread_create(&thread, NULL, threadProc, NULL);
// Setup the stage
stage = internal::get_Stage();
stage->scaleMode = flash::display::StageScaleMode::NO_SCALE;
stage->align = flash::display::StageAlign::TOP_LEFT;
stage->frameRate = 60;
// Ask for a Stage3D context to be created
s3d = var(var(stage->stage3Ds)[0]);
s3d->addEventListener(flash::events::Event::CONTEXT3D_CREATE, Function::_new(initContext3D, NULL));
s3d->addEventListener(flash::events::ErrorEvent::ERROR, Function::_new(context3DError, NULL));
s3d->requestContext3D(flash::display3D::Context3DRenderMode::AUTO,
flash::display3D::Context3DProfile::BASELINE_CONSTRAINED);
// Suspend main() and return to the Flash runloop
AS3_GoAsync();
and here's the function
void *threadProc(void *arg)
{
printf("From a thread!");
}
threadProc never gets executed.
I found this manual page, but I don't think there's anything there. What am I missing?