compatibility of native code C++ and openGL in Windows Phone 7 - c++

We have a windows mobile 6.5 gaming application which uses openGL . Now we planned to port it to WP7 (windows phone 7).
When I check the compatibility of native code C++ and openGL in WP7, they are telling that there is no support in the WP7. WP7 support only Silverlight, XNA and the .NET Framework.
So what we thought of use XNA.Is it is the right to use this?
Please let me know how to proceed with this. And which is the best way to go about it.

well I am doing exactly the same thing now.
I'm currently going through the painstaking process of just manually converting all the code to c#. there is no little saviour like the Android NDK here with winmo7, you HAVE to use c#
if I had my time I would and WILL definitely look into something that converts from c++ to c#, it is completely unrealistic to try and manage a multi platform project across multiple languages.
depending on your app: silverlight I believe is meant for the more 'Applicationy' type apps, where XNA is meant for games (or 3D apps), but I think both are coded in c#
EDIT: lol, sorry skipped over the part about how you were porting an openGL game, definitely use XNA, converting from openGL to XNA(directX like) will be the least of your worries, its fairly strait forward. its converting the code that's the pain. XNA is meant for n00bs writing stuff from scratch, and for them, it is awesome. to that end, it is good if you still have all your asset's source: hopefully still having your max or maya model files, and tga/bmp/png texture source files. if so, the content pipeline will automatically convert textures, and for models, converts .x or .fbx files exported from max or maya.

Related

Game engine C++ and objective C/Xcode coding

I'm quite confused.
I want to develop a 3D game app. I have Unreal engine or Unity to choose from.
Both of them are coded in C++.
Where I have to use objective c that is the main language for iOS?
Can I do the app totally in the game engine Unity/UDK, coded there and then send it to the app store without any programing in objective c and straight from the game engine without using Xcode?
I really hope that the 6 month of full immersion in objective C/xcode were a waist of time.
Sorry if this question is very low level
Thank you
Regards
CL
If you are looking into programming for iOS... Yes you will need to know Objective-C (as it is the main language) and Xcode.
If you are looking to develop a 3D game, start looking into OpenGL ES.
You can't just write a game for Unreal/Unity and send it to the app store... doesn't exactly work that way.
With Unity3D, it is not C++ it is C#
Both are great engines, but if you are new to this, suggest going with Unity3D. Its easier to learn, with tons of free or cheap, easily accessible scripts and art.
and yes you can create the whole game in-Unity-engine, submit to apple and have it Live to the world (without knowing or needing any objective C)
You can also upload it to the app store submission with only a few setup steps.
You will need to download and install XCODE, but you don't need to learn any XCODE programming or project setup as unity does it all for you.
You won't need to learn OGL, or shader language (Unity comes with a suite of free, optimized mobile shaders) though it is fun to learn how to make your own later on.
Any native (objective C) stuff you might need, you can all do just by buying cheap plugins for unity that others have written. (usually in the $20 -$50) range.
You will need.. an apple developer account $100 a year.
Unity for iOS... basic or pro version.
a Mac, or a Hackintosh on a PC (mac mini is the easiest / compromise price route to go)
an iOS device would also help. (suggest getting several different ones for testing, or asking friends)
You could also do Droid instead of iOS. You dont need a mac then. But iOS apps make most of the money. something like 70% iOS 30% droid.
have fun!
You will have to create an Objective-C wrapper.
This is a good start point.
TECH TALK: BRIDGING UNITY AND THE IOS SDK

Searching for framework for my application

I am searching for a framework(preferably c++, but i can learn other languages too) for my application. I will write what i need:
Borderless window(no buttons,frames etc.)
Real time 3d model rendering(or at least easy way to show 2d animation made from 3d model)
Cross-platform support(not mandatory)
If there is any other details you need to know, please tell me.
Thanks in advance.
Xojo will also do what you want. It creates Windows, OS X and Linux desktop apps and has built-in support for OpenGL.
http://www.xojo.com
One of the best cross-platform Gui-Frameworks for C++ is Qt. It can do 3d-stuff using OpenGL too. However, if you only need a plain window without any controls you may want to look into the next OpenGL tutorial for some infos.
I recommend Unity.
It works in Windows, Mac, Linux, iOS, and Android. (Furthermore in some game consoles.)
Its support languages are C#, boo and js.
C# is like C++ and easy to learn.

OpenGL in XNA is it possible?

I was wandering is there a way to work in XNA using OpenGL, this is not counting Xamarin products, and if it is, is there any tutorials of how to set XNA libraries or whatever it uses. I need such combination to start working on I projects until I buy MonoDroid, so the projects with effects be easily ported to Android.
Microsoft XNA is a framework built upon DirectX; you cannot just run it upon OpenGL.
Long answer to your question: you should look at MonoGame (http://monogame.codeplex.com/): it is an open source replacement for XNA, which runs on many platforms.
It is not XNA (you will need to retarget your project to MonoGame, IIRC), but it is almost a drop-in replacement (there are many success stories of porting games in minutes to hours).
XNA is DirectX only. If you want to use OpenGL on .NET, there are multiple libraries for this:
OpentTK (the most popular) or SharpGL

3D and UI toolkit

I have to develop a basic inventory system, and my client wants to see all the objects in the inventory in 3D and their positions in the warehouse. The thing is that I have to develop this as soon as possible, delivery time is my priority here. So I came to the conclusion that I would need a powerful 3D graphics engine and an UI toolkit that can be easily integrated with it. I've plenty of experience with C++, Qt, OpenGL, VTK, C# and WinForms. In my experience, VTK is not so good with textures and it would involve more work to add the eye candy my client wants (like animations, visual effects, etc). I've tried Axiom with WinForms. I went through hell making a sample load and run (framework incompatibilities, rendering engines not found, codec native dependencies missing, etc).
I have been evaluating different options:
Qt + Ogre (C++)
WinForms + Axiom (.NET)
Qt + Irrlicht (C++)
Which do you think would be the best option? Could you recommend me some other possibility?
Thanks in advance!
I spent a heap of time developing with Mogre (a C# wrapper around Ogre) and WinForms. In my opinion it's a good combination because you can develop the GUI much faster in C# WinForms than any of the C++ options.
If you don't mind using a C# wrapper around the C++ Ogre library I recommend using Mogre rather than Axiom. It is very stable, has some good maintainers and keeps up with the latest version of Ogre pretty well. Any code on the Ogre forums can easily be ported to C# because most of the API is identical.
Axiom is a pure .NET port of Ogre, although it lags a few versions behind and may have some missing features. I haven't spent a lot of time with it but I believe it's main strength is that it's all managed code, if that's important to you.
There's an open source project called Glue Editor that I started a while ago. It's no longer maintained but it has a lot of code you can use to get Mogre working with WinForms. You should be able to download the repository and compile it out of the box. You're welcome to take the code and use it however you like.
https://bitbucket.org/glue/glueeditor/src
If you decide to go down the Qt + Ogre path there's a project called Ogitor you might want to check out.
https://bitbucket.org/jacmoe/ogitor/src
You might also want to check out XNA and MonoGame. XNA is Microsofts framework for making games in C#. It is fairly bare bones but it has a much lower learning curve than Ogre, Mogre or Axiom. MonoGame is an open source implementation of the XNA framework that works on non-Microsoft platforms (e.g. Android, iOS, Linux).
http://monogame.codeplex.com/
I recommend Qt + Ogre (C++), although I have to confess this is the only combination from your list I have much experience with. The good thing about Ogre is the amount of documentation and the active community. So many questions are answered and documented. The graphics itself can probably be created in all library combinations. However, I like the easy intergration of object interaction in Ogre. The standard is based on bounding boxes, however there is code available for triangle intersection as well. Wish you luck!

What is the best approach to use openGL in the web?

I wrote a program in C++/OpenGL (using Dev-C++ compiler) for my calculus 2 class. The teacher liked the program and he requested me to somehow put it online so that instead of downloading the .exe I can just run it on the web browser. Kinda like java applets run on the browser.
The question is:
How if possible, can I display a C++/OpenGL program in a web browser?
I am thinking of moving to JOGL which is a java interpretation of OpenGL but I rather stay in C++ since I am more familiar with it.
Also is there any other better and easier 3D web base API that I can consider?
There is a lot activity recently with WebGL. It is a binding for Javascript to native OpenGL ES 2.0 implementations, designed as an extension of the canvas HTML5 element.
It is supported by the nightly builds of Firefox, Safari, Chrome and Opera.
Have a look at these tutorials, based on the well known NeHe OpenGL tutorials.
Several projects based on WebGL are emerging, most notably Scenegraphs APIs.
From Indie teams: SceneJS, GLGE, SpiderGL.
From Google: the team behind O3D plugin is trying to implement a pure WebGL backend (source) for the project, so that no plugin will be necessary.
From W3C/Web3D: There is an ongoing discussion to include X3D as part of any HTML5 DOM tree, much like SVG in HTML4. The X3DOM project was born last year to support this idea. Now it is using WebGL as its render backend, and is version 1.0 since March 2010.
I'm almost sure that WebGL is the way to go in the near future. Mozilla/Google/Apple/Opera are promoting it, and if the technology works and there is sufficient customer/developer demand, maybe Microsoft will implement it on IE (let's hope that there will be no "WebDX"!).
AFAIK, there's only 3 options:
Java. it includes the whole OpenGL stack.
Google's Native Client (NaCL), essentially it's a plugin that let's you run executable x86 code. Just compile it and call it from HTML. Highly experimental, and nobody will have it already installed. Not sure if it gives you access to OpenGL libraries.
Canvas:3D. Another very experimental project. This is an accelerated 3D API accessible from JavaScript. AFAICT, it's only on experimental builds of Firefox.
I'd go for Java, if at all.
OTOH, if it's mostly vectorial works (without lots of textures and illumination/shadows), you might make it work on SVG simply by projecting your vectors from 3D to 2D. In that case, you can achieve cross-browser compatibility using SVGWeb, it's a simple JavaScript library that allows you to transparently use either the browser's native SVG support or a Flash-based SVG renderer.
Do you really have the time to rewrite it? I thought students were meant to be too busy for non-essential assignment work.
But if you really want to do it, perhaps a preview of it running as a flash movie is the easiest way. Then it's just a matter of doing that and you could provide a download link to the real application if people are interested.
Outside of Java, in-browser OpenGL is really in its infancy. Google's launched a really cool API and plugin for it though. It's called O3D:
http://code.google.com/apis/o3d/
Article about the overall initiative:
http://www.macworld.com/article/142079/2009/08/webgl.html
It's not OpenGL, but the Web3D Consortium's X3D specification may be of interest.
Another solution is to use Emscripten (a source-to-source compiler).
Emscripten supports C/C++ and OpenGL and will translate the source into html/JavaScript.
To use Emscripten you will need to use SDL as a platform abstraction layer (for getting an OpenGL context as well as loading images).
Emscripten is currently being used in Unreal Engine and will also be used in the Unity 5 engine.
Read more about the project here:
https://github.com/kripken/emscripten
Two approaches:
Switch to Java. However, your application will suffer from a loss of performance as a trade off for portability. But since Java is everywhere, this approach ensures that your code can be executed in most browsers.
Use ActiveX, which allows you to run native binary code for Microsoft Windows. This is not recommended in production because activeX is well known as a potential security hole, but since your lecturer is the one viewing it, security doesn't seem to be a big deal. This is applicable for Microsoft platform (Windows+IE) only.