Hi everyone, absolutely new to OGX here (and pretty much to C/Windows, I do have a load of experience with C and linux).
Due to some restrictions I will only be able to work on windows, so I tried getting started. I managed to successfully compile the example using c::b (needed to add the include paths, the library paths, copy the orx dlls and download libgcc_s_dw2-1.dll and libstdc++-6.dll).
The problem is that the program dies within the orxConfig_Load.
The first thing I noticed is that c::b won't compile if I don't add the main() function in the code, so i did:
int main(int argc, char* argv[]){
return Init();
}
After taking some look at the code, I tried checking the return value of the orxConfig_Load, still it won't return:
/* Loads config file */
if(orxConfig_Load("01_Object.ini") == orxSTATUS_FAILURE){
printf("Error opening file.
");
return 0;
}
else{
printf("Yey, opened.
");
}
I also changed the ini to use the text, instead of the texture. I am running windows 7 x64 and code::blocks, had the same problems with windows XP 32.
Any help is welcome.
Thanks in advance.
Comments
Knolan wrote:
Not sure about ogx, but we should be able to help you with orx.
Sounds good. Also, if you were to use the SVN version you shouldn't need the dw2 dll anymore.
I believe I'm missing some context here.
Are you trying to use the official tutorial code here? If so, they were written to be used as dynamically loaded plugins using orx launcher.
That means they don't need a main() function but a custom entry point as explained at the end of this page: http://orx-project.org/wiki/en/orx/tutorials/object
Only tutorials 10 and after are meant to be used as stand alones and will thus need a main() and won't rely on the launcher.
Now that being said, calling Init() in the main function is not going to run orx, simply executing what you wrote in the Init() function, of course.
I'd recommend first either looking at Grey's tutorials (http://orx-project.org/wiki/en/orx/tutorials/community/grey) or jump directly to the tutorials 10/11/12 to see how to make a stand alone application.
That happens as orx isn't running at all, and thus calling any of its function will fail.
For running orx in launcher mode, you need to define the library entry point with
For the stand alone mode, you need 3 functions (Init, Run and Exit) and run orx this way:
Hope this shed some light on your problem. Also someone else had a very similar issue recently. More info here: https://forum.orx-project.org/discussion/3713
And sorry about the OGX thing, I have been reading so many names in my search for a game engine that can create Ios and Android games that I am starting to get things a little messed up :unsure:
And no worries for the name, I was just teasing.
If you have any other question, don't hesitate. Approaching orx might sound tricky at first but in my opinion it's all worth it if you decide to stick around.