I am not sure what you are trying to do, especially without the actuals errors, you should dump them on a pastebin and copy the link here next time.
By look of it, you are trying to give windows/linux headers (glx for example) to flascc for libraries that simply doesn't exist in flash. You have to treat flascc as a separate target, it's not linux, it's not windows, it's not bsd. It's something else. Flascc doesn't have opengl it has stage3D, so your opengl code won't compile directly you need the GLS3D project. Which you seems to already include, but am not quite sure. This library, will abstract stage3d to your app, make it look like opengl.
That is for opengl, but there is no flascc abstraction of x11. If your lib does need x11, you are screwed. You'll have to find something else or get dirty and write it yourself. It's not that hard though and there is plenty of tutorial about it.
HI Joe ( or twistedjoe),
Thanks for your quick reply! That's fantastic and it clears much of my doubts! Sorry I am new to flascc.
You are right, SOIL was not designed for flascc, so trying to compile it directly might be an dead end.
I am using Freeglut so it looks like opengl/glut.
- Freeglut 2.8.0 ported to Flash with FlasCC and Stage3D.
I compared my codes and those examples in the demos folder, they are mostly identical, that's why majority of functionalities can be compiled under flascc as this freeglut 2.8.0 library already did lots of the dirty work of porting to Stage3D
Anyway, I want to find the best way to load textures in flascc, the example in demo folder of freeglut, gives a way to load .tga files as texture, however, i would like some generic way of loading images such as jpg, png or bmp, that's why I was trying SOIL and hope it is also Stage3D ready, seems like it isn't!
So, I have two more questions:
1. I see the freeglut library was compiled as static lib (libglut.a) using the following command:
@$(FLASCC)/usr/bin/ar crus install/usr/lib/libglut.a src/*.o
and then linked to flascc.
Is it possible to do the same thing, say compile static lib ( libSOIL.a) and then link to flascc in the same way? I saw in some of previous posts in this forum, it is said
it is possible to statically link external library to flascc, however, the external static library must be flascc -compatible
How to compile a static library that is compatible to flascc ? ( I do have all source of SOIL library)
2. What is the best way to load texture images ( jpg, png, bmp) in flascc ?
Thank you so much!
An old thread but I'll try to answer the remaining questions anyway
1) Your question should probably be "how to compile a static lib", because once you got that and you got your sources - AND your sources are "cross-platform", you can compile a static lib for FlasCC out of anything. The process should be the same on all platforms with gcc (or g++). Described for example here: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
The idea is to compile the sources into individual .o files with -c switch, then use "ar" to connect them into .a. Of course you'll need to use gcc and "ar" from the FlasCC SDK to get FlasCC compatible library. That answers the part about FlasCC compatibility. If your library comes with configure, then you might (often with only few adjustments) compile the libs using that. I was able to compile the complete ffmpeg library for FlasCC (as well as libvorbis, libtheora etc.)
2) I think the best way is to find libraries which will load these image formats for you. There are surely lots of those. Then once you'veg to the raw image (decompressed) in memory I guess it's only a matter of converting it into the format you need for the textures. It shouldn't be that hard really.