Is possible on easy way to program in c++/lua in unity? - c++

I want to learn Unity but C# is not my first choice. Is possible to program in c++/lua in unity ?
I want to escape from marmalade to unity or shiva.

I will start by saying that C# is my favorite language and although I sometimes wish Unity could be fully programmed in C++ (especially when I need something that C++ would give) I do think C# lets you do almost everything you need but just a bit slower than C++.
You can make plugins with C++ but that is it.
Any particular reason why you want to do C++? Also if you know C++ you already know C#.

No it is not possible. Except for plugin development.
http://forum.unity3d.com/threads/68109-Unity-and-C
http://answers.unity3d.com/questions/12809/can-i-use-c-as-a-scripting-lanques-for-unity.html

Related

how to port VB code in C++

I want to use VB.NET code in win32 (C++) (I dont want to convert my code). I have heard about wrapping VB code in COM but i don't know how to do it. Also, I am not aware if there is an alternative (or any better) way of porting the code.
Any help is appereciated.
Update: I created a class library in vb and saved it as a dll after setting the comvisible attribute to true, then imported it in my c++ project and accessed the interfaces via COM
*thank you everone for helping me out !!!!!!! *
You cannot call .NET code directly from a native C++ application, so there is some work involved.
Of course, your question leaves us guessing at why you're wanting to do this, but unless you are still going to be using the library from a .NET application, I would be a strong advocate in favor of porting it (like your title suggests) to C++.
But if you don't want to do this, you have a couple of other options:
Write a wrapper around the VB.NET code using C++/CLI. This would probably be the simpler solution, especially if you're reasonably familiar with both the VB.NET and C++ languages.
Expose the VB.NET methods you need as COM functions, using the <ComVisible(true)> attribute. This is going to be a bit trickier to get going, especially if you're uncomfortable or unfamiliar with COM programming in C++. It's too much to explain in a Stack Overflow answer; investigate purchasing a good book on COM programming. And although you're using VB.NET, the steps are basically the same for C#, for which you'll have much better luck finding examples.
You can't directly port VB into C++, but if you are looking to just switch to a more powerful language and still use the GUI libraries, you can check out C#. It uses very similar code, and a quick google search provided me this program: C# converter. If you really need C++, you could probably then convert the C# code to C++, but there really wouldn't be a need to since C# is VERY close to C++. Just googling that I found this: C++ converter.
I hope this will help you.

Something like unity but for C++ programmers

is there anything similar to unity but with the difference that instead of javascript I can use C++?
It is funny, I was looking to learn a little bit of unity as I seen it as requirement for some postings... and I found this question.
I think Ogre3D is great... it may be what you are looking for.
here is the link ogre3d.org
Ogre3D is what I used. http://www.ogre3d.org/
It is somewhat of a misconception that Unity uses Javascript. The so-called Javascript used in Unity is actually a dialect of Javascript that is CLI-compatible and is not exactly the same as the official Javascript. Also, you are not limited to using Javascript in Unity. You can also use C#, which is similar to C++ and Java in some ways or the less commonly used Boo script.
Personally, I would recommend using C# in Unity because it is very powerful and allows calling of native C/C++ functions via P/Invoke. Here is a link to the use of plugins:
http://unity3d.com/support/documentation/Manual/Plugins.html
Link to list of Game Engines. Please take your time to read and consider them:
http://en.wikipedia.org/wiki/List_of_game_engines
If you want accessibility offered by Unity, C++ is certainly wrong choice. Much better would be interpreted/script language, such as Python. They are more flexible in terms of working in web browser/many os-es.
If you're interested in targetting mobile platforms then Marmalade might be a good fit.
Panda3D It's not a think compared to Unity, but it can work as a web plugin, cross-platform. It has a lack of IDE, but it is opensource.
As far as I know, there is no need to use JavaScript or Boo with Unity, and there is nothing wrong with C# acting like script language ( which is really hard with C++ ).
as a unity developer, I liked to add c++ to by knowledge base as all AAA games are made by C++ and I was looking for something like unity but for CPP. the only good cpp engine is unreal that doesn't really support c++. the language is a dialect of c++ and there are big differences. like very
rare usages of pointer and references
more syntaxes like c# attributes(cpp has not attribute)
...
so you don't learn memory management. the nearest thing that I could find was COCOS2dx as the whole framework is written in pure standard c++ and many libraries like UI and Physics are already added. you can write your own engine and editor with it.
Unreal Engine uses C++
default standard is C++14
https://www.unrealengine.com

Tired of building web applications? Trying maybe C++?

I'm getting a little tired of building web applications. Feels like same thing over and over again. Are there any other cool things you can do. I'm maybe getting to start coding in C++.
Any suggestions for tips in that area? Should I delve into Qt or MFC? Any suggestions?
My latest interest is in Robotics. You can get a microcontroller for about $30 (arduino.cc) - and miscellaneous motors off of E-bay. I also have some cheap rangefinders and a GPS receiver - each of them under $30...
I build web apps as well. I'm not really tired of it, but I spend all my spare time programming in C.
If you're just starting out in C++, I recommend starting with some simple console-based applications first. Get used to the syntax and some fundamentals like strong typing, pointers, and understanding the difference between pointers and references. (Depending on your experience as a developer, you may already know all or most of the theory behind these concepts.)
If you're comfortable with these things, building GUI applications is easier (although still far from trivial.) I'd recommend going with a toolkit like Qt rather than MFC, which is largely deprecated in favor of dot NET, if I'm not mistaken.
Edit: also, consider trying out a language like C# instead. C# is newer, a little more cohesive, and lets you use dot NET for building Windows GUI applications.
Write a game. An action game. Like, a shoot-them up for example.
You'll discover the other face of programming. Use whatever you want to make it. C++ is a good choice, but any language will be good. C++ will be harder to "master" than other languages but learning it will make you understand a lot about other languages. But that's your choice : the project domain is more important than the language (that is just the tool).
Just try to make a game, I think it will really be different and you'll discover a lot of interesting things. I recommand a shoot them up because it's visual, make you learn basic graphic rendering, basic collision management and is a good base for a potentially interesting game (if you add a feature that makes it stand appart) that will keep your motivations for learning.
Look into mobile application development like on Android or iphone. C/C++ will come in handy.
C++ is great and all, but writing GUIs in MFC is just stupidly painfully compared to any other reasonable framework out there, like .NET (VB, C#, C++/CLI, pick your language) or Cocoa/Obj-C on the Mac OS X / iPhone OS. Qt is probably better than MFC.
Buy "The C Programming Language" by Kernighan and Ritchie and work through it.
Ideally, you also have access to an OSX/Linux system and can work on that. (C and Unix go hand in hand).
If you're used to working in relatively high-level languages such as C# or PHP, going back to something like C++ where you need to do your own memory allocation and other low-level stuff will probably seem cumbersome. Personally, I was happier making the switch in the other direction, and having much more done for me.
But if you do want a challenge, C++ could be a good option. Or, go straight to embedded. Robotics is a very fun topic, try to fit interesting things (that really move!) inside the 2-KB RAM environment of a PIC microcontroller :-)
I would recommend trying to implement something useful in C/C++. Is these a utility in your operating system you don't like? That you think you could improve? Have you always wanted to do X easily and have a good idea? No matter how big it might seem, research it. Learning an OSes API will teach you a lot about C/C++. Add a user interface in the library of your choice to learn even more. Basically, push the envelope a bit - building a calculator is great or a little console app for learning a few things, but building a fully fledged app with a purpose will really teach you things.
Add intelligence to a simple game using a neural network. I've always wanted to add a neural net to Oware to see if it improves its wins.
If your into pain, you could correct flaws on Windows Vista and 7. :-(
I'd recommend moving to Python rather than C++ if you're coming from a web design background. Get good at object-oriented programming, encapsulation, and related things before you go to C++ and have to deal with pointers and cleaning up after yourself.

Is there a way to use C++ for iPhone development?

Sorry if this is mentioned somewhere, couldn't find any info about it. Post a comment if you find a duplicate.
This is not about whether it's possible at all to compile a C++ program for the iPhone (which I suppose is possible).
Basically the question is, can you bridge between Objective C and C++?, and if it is possible, would it be feasible to wrap the entire Cocoa Touch API for iPhone with a nice C++ library?
I know nothing about Objective C, and I would really like the idea of bringing my current skills in C++ to the iPhone.
EDIT: Very similar question here
This question is very close to duplicating your own.
However, I would suggest spending a little more time with Objective-C. I had done C++ development myself before learning Objective-C, and it was a pretty smooth transition. Many of the core concepts are the same, and all of your base C skills will translate across. I think that once you get a little ways into it, you'll find that direct Objective-C interaction with the Cocoa frameworks is really the way to go on the Mac and iPhone. There are many great resources for getting started, like the ones I list here.
Admittedly, there are some cases where it's preferred to have a cross-platform C++ engine behind the scenes, and an Objective-C / Cocoa UI.

Is it possible to program iPhone in C++

I'm all for language diversity, but Objective C is insane. So I'm curious: is it possible to code iPhone apps with C++ while using the Cocoa API, etc?
Although Objective-C does indeed appear to be "insane" initially, I encourage you to stick with it. Once you have an "a-ha" moment, suddenly it all starts to make sense. For me it took about 2 weeks of focused Objective-C concentration to really understand the Cocoa frameworks, the language, and how it all fits together. But once I really "got" it, it was very very exciting.
It sounds cliché, but it's true. Stick it out.
Of course, if you're bringing in C++ libraries or existing C++ code, you can use those modules with Objective-C/Objective-C++.
Short answer, yes, sort of. You can use Objective-C++, which you can read about at Apple Developer Connection.
If you know C++ already, learning Objective-C would be pretty simple, if you decided to give that a try. More info on that topic is at the ADC as well.
I use Objective-C to slap the UI together.
But the hard guts of the code is still written in C++.
That is the main purpose of Objective-C the UI interface and handling the events.
And it works great for that purpose.
I still like C++ as the backend for the code though (but that's mainly becuase I like C++) you could quite easily use Objective-C for the backend of the application as well.
First off, saying Objective-C is "insane" is humorous- I have the Bjarne Stroustrup C++ book sitting by my side which clocks in at 1020 pages. Apple's PDF on Objective-C is 141.
If you want to use UIKit it will be very, very difficult for you to do anything in C++. Any serious iPhone app that conforms to Apple's UI will need it's UI portions to be written in Objective-C. Only if you're writing an OpenGL game can you stick almost entirely to C/C++.
Having some experience of this, you can indeed use C++ code for your "core" code, but you have to use objective-C for anything iPhone specific.
Don't try to force Objective-C to act like C++. At first it will seem to you this is possible, but the resulting code really won't work well with Cocoa, and you will get very confused as to what is going on. Take the time to learn properly, without any C++ around, how to build GUIs and iPhone applications, then link in your C++ base.
You have to use Objective C to interface with the Cocoa API, so there is no choice. Of course, you can use as much C++ as you like behind the scenes (Objective C++ makes this easy).
It is an insane language indeed, but it's also... kind of fun to use once you're a bit used to it. :-)
I'm not sure about C++, but you can definitely code iPhone applications in C#, using a product called MonoTouch.
You can see this post for detailed discussion on MonoTouch Vs Obj-C: How to decide between MonoTouch and Objective-C?
I'm in the process of porting a computation-intensive Android app written in Java to iOS6. I'm doing this by porting the non-UI parts from Java to C++, writing the (minimal) UI parts in Obj-C, and wrapping the former in a (small) C interface using the standard C/C++ technique, so that it can be accessed from Obj-C, which is after all a superset of C.
This has been effective so far, and I haven't encountered any gotchas. It seems to be a legitimate approach, since Xcode lets you create C++ classes as well as Obj-C classes, and some of the official sample code does things this way. I haven't had to go outside any officially supported interfaces to do this.
There wouldn't seem to be much to gain from writing my remaining UI code in C++ even if it were possible, in view of the help given to you by the interface builder in Xcode, so my answer would be that you can use C++ for almost all your app, or as much of it as you find appropriate/convenient.
Yes but Thinking that you can program every kind of program in a single language is a flawed idea unless you are writing very simple programs. Objective C is for Cocoa as C# is for .NET, Use the right tool for right job, Trying to make C++ interact to Cocoa via writing bridging code and trying to make C++ code behave according to Cocoa requirements is not a good idea neither expecting C++ performance from Objective C is. You should try to layout design and architecture of app keeping in view existing skills and determine which part should be written in which language then build accordingly.
I'm currently writing an Objective-C++ framework called Objective-X, wich makes PURE C++ iPHONE PROGRAMMING possible. You can do like this:
#import "ObjectiveX.h"
void GUIApplicationMain() {
    GUIAlert Alert;
    GUILabel Label;
    GUIScreen MainScreen;
    Alert.set_text(#"Just a lovely alert box!");
    Alert.set_title(#"Hello!");
    Alert.set_button(#"Okay");
    Alert.show();
    Label.set_text(#"Ciao!");
    Label.set_position(100, 200, 120, 40);
    MainScreen.init();
    MainScreen.addGUIControl(Label.init());
}
and compile it using GCC's appropriate commandline options. I've already compiled this helloworld app&it w0rkX0rz like a charm. ;-) It'll available soon on GoogleCode. Search for Objective-X or visit http://infotronix.orgfree.com/objectivex approx. a week later!
Updated (but apparently inactive) URL: http://code.google.com/p/objectivex/
It may be a bit offtopic, but anyway. You can program c++ right on iOS devices. Check out CppCode ios app - http://cppcode.info. I believe it helps to learn c and c++ and objective-c later.