Unity3d iOS c++ native library plugin. How to? - c++

I'm using this c++ particle physics library in my game. So far I have it working in unity on android and windows.
I'm now looking into getting it working on iOS and it seems like quite a daunting task.
The library is a superset of Box2D so it is quite a large complex library.
Here is my idea for tackling this, I'm hoping someone with some experience can say if they think this might work, or if not suggest a better way of doing it.
My idea is to..
Use Unitys 'Automated plugin integration' where you add your .cpp and .h source files to the Assets\Plugins\iOS folder and it sym links them in the xcode project (whatever that means)
The problem here is that subfolders are not supported so I would have to flatten the directory structure of the Box2D project and put everything in one folder. My idea is to do this using a python script that will change all the include statements in the source code so for example..
#include <Box2D/Common/b2Settings.h>
would be changed to..
#include <b2Settings.h>
Is there a reason this would not work?

Ok, So that crazy idea actually worked! The performance was terrible on an iphone 4 but absolutely flawless on a iphone 5. The only other issue I had was I had to turn
#include <Box2D/Common/b2Settings.h>
into
#include "b2Settings.h"
Xcode didnt like the pointy brackets.
Also this failed to build on the simulator but worked on an actual device

Related

How to actually use c++ Nana

I am a beginner in c++. I want to use nana for a cross platform GUI in this github project, Flying fur doggys, but I have no experience with cmake. How do I attach nana to my project with cmake, I have tried a few different online resources but they all seem too complicated. If there is any easy way to install it, with clion as well, please let me know.
I have tried copying the source code and using the very little knowledge I have, tried to add the files for my project to the cmake txt. The program isn't working at all.
If there is another project that is better for beginners, that is cross platform. I'd be happy to use it as long as I know how to install it ;)

How do I get CodeLite to find headers for FLTK or wxWidgets (MacOSX)?

My apologies, I realize this question may be covered in other questions/articles, but I am not very knowledgeable about "under-the-hood" computer workings, and I have only gotten frustrated so far by trying to look up existing answers.
I'm just trying to teach myself some programming, and I'd like to tinker with a GUI. I'm trying to use CodeLite, and trying to make use of either FLTK 1.3.5 or wxWidgets 3.1.3. I get the sense that I need to do something with
Project Settings->Compiler->Include Paths, and/or Project Settings->Linker->Libraries Search Path (and ->Libraries), or possibly Environment->environment variables.
The problem is I don't know exactly what to put, as when I open the folder for either wxW or FLTK there is a sea of files and I don't know what exactly I'm trying to get CodeLite to find. I'm also used to double-clicking icons, and when it says to specify a path I don't know if I'm clear on the syntax for that.
Can someone let me know what to do to simply use
#include <wx/wx.h> or #include <Fl/fl.h>
and not run into any problems?
CodeLite 12.0.3, MacOSX 10.14.2, clang 1001.0.46.4

Linking .ui files into C++

I have done all sorts of research into how to build a GUI in C++. I finally downloaded Qt4Designer because I thought that was my best bet. The problem is that I don't know how to use .ui files in my C++ code. I looked at Linking a qtDesigner .ui file to python/pyqt? and Difficult linking ui tree widget and header/cpp files, but I'm not extremely advanced and I don't have a lot of time, so if someone could explain to me exactly how to include the files in my code, that would be great. I admit that can't understand every little detail in that code because I am just starting out in the great world of computer programming. Another part of the problem is that I don't know how to implement the GUI into my code. What that means: If x button is pressed, what does my C++ code do? Please be patient with the question and its naiveness, I'm not an expert and I'm not claiming to be.
Well, you can use QtCreator or you can learn the magic of qmake, which comes with Qt by default. Also you can try CMake QT tutorial which shows you how to build your QT appls but with a more power tool and feature.

To what extent can I make my C++/OpenGL project work on both iPad and PC?

I'm developing a little game on Linux at the moment but I'd like to try making an iPad app out of it.
I've been looking over tutorials and it seems like I'll be able to make the my core C++ code compile on XCode without modification (it has no dependencies outside the standard library), and if I use OpenGL with SDL for the UI then the bulk of that code should be portable as well.
I assume that a certain amount of code will have to be different between the build processes, obviously I'd like to minimise that. I've never done any XCode development before, so can someone please advise on the following:
Will I be able to make the XCode project point to the core library source tree and compile it without dicking around with it, inserting project files etc? In other words, can I keep all XCode-specific files somewhere completely different? I use CMake on Linux and like would like to keep the out-of-tree build approach.
What at the SDL layer will have to be done differently for the iOS build? In other words, if I have a slave libgraphics library which is SDL and can paint the core state into a context provided by its master application, how do I create this context differently on iOS as compared to Linux?
At the moment I know nothing about the particulars of window creation and user input on iOS, or any Apple product caveats (e.g. how do I respond to the iPad going to sleep). I'd appreciate any pointers about all of this but the real question here is how do I structure the project so as to be maximally cross-platform?

PlaySound() In C++ Doesn't Work

I've been trying to figure this out, and I just can't seem to.
When you include window.h at the top, there is supposed to be a PlaySound() function inside of it.
I added window.h but I keep on getting a "PlaySound was not declared in this scope" error.
I tried going into the project's build options and adding "-lwinmm" into the linker settings, but it still doesn't work.
I'm using Code::Blocks.
Anyone have a solution?
You need to #include both windows.h and mmsystem.h, in that order. This is noted in the community section of the documentation.
I assume you are coding on windows and you actually wanted the interface file called "Windows.h". Also make sure you are using the correct namespace, I'm not a windows programmer, but that's a start. I also don't know haw you are loading the file or wether you are using the win32 or .net frameworks. But then from the sounds of it you might not either.
If you're trying to use .net you can start here
http://msdn.microsoft.com/en-us/library/system.media.soundplayer
win 32 start here
http://msdn.microsoft.com/en-us/library/ff818516(v=vs.85).aspx
ah here it is winCE audio API
http://msdn.microsoft.com/en-us/library/aa909766.aspx