C++ and exporting to Android

Hello,

When using the Visual Studio 2015 C++ project is there anything I need to keep in mind if I plan on exporting to Android? Is there any risk of including a Microsoft header file that will be incompatible?

Also, would you be able to create a similar project except with Code::Blocks and use MinGW C++?

Thank you for making raylib available and the work that you put into it. It's a very nice library.

Mark

Comments

  • Hello Mark!

    raylib itself is prepared to export the same code on any platform but if you plan to use any additional library, make sure they are not platform specific (for example Windows-only). Fortunately, there are lots of C/C++ libraries that are platform-independant (only rely on standard C/C++ libraries).

    It's been a long time not using Code::Blocks and I'd would need some time to look into the IDE... but I could better create a generic doc to configure raylib in any IDE, after all, you just need to configure a couple of include paths and libraries to link.

    Thanks to you for using raylib, keep me updated with your progress! :)
  • edited January 13
    A generic document for configuring would be great.

    The reason I was going to use C++ is because I could not figure out a way to do a collection of various sizes, like an expandable array, for storing inventory information.

    However, I think I found a good library that offers that functionality so I'm going to try going back to C now.

    Oh, and one other question. How do I use a ttf like pixantiqua.ttf?

    Thanks.





  • Hey Markz!

    I'll try to prepare that generic config doc as soon as possible, I'm a bit overloaded lately...

    Actually, you can go with C++, raylib is C but works with C and C++. If you want to stay with C, I recommend you checking this page:https://github.com/nothings/single_file_libs, it lists a bunch of small C/C++ libraries ready to be included in any project, data structures ones: https://github.com/nothings/single_file_libs#data-structures

    About using a TTF font, you can just load it as a regural SpriteFont using LoadSpriteFont() or use LoadSpriteFontTTF() for some additional configuration parameters. Here it is an example: http://www.raylib.com/examples_web/exmain.html?name=text_ttf_loading

    Cheers.
  • I could not figure out getting the C libraries to work so I went back to C++ under Visual Studio and everything is working great! It took me a couple of hours but I also managed to move the solution to my DropBox folder instead of under rylib. I learned a lot by doing this.

    Thank you for the TTF example code. I got my code working with the TTF now too.

    Do you have recommendation on a good vertical screen size when developing for Android devices?

    Thank you again!




  • Hey! That's great! That's the objective: keep learning! :smiley:

    About screen sizes for Android, there is not an easy answer, Android market is very segmented (lots of possible resolutions) but my personal recommendation would be using 1280x720 (or 720x1280), it's pretty standard and raylib will managed any required scaling for you.
  • I believe codeblocks let's you import ms visual studio projects

    I haven't tried it with raylib yet
Sign In or Register to comment.