Compiling/Running C++ code on iPhone - c++

I have recently created an Asteroids game/app for one of my CS classes with openGL, GLU and C++ for Linux. The teacher told me that if I get it to run on the iPhone he would give me extra credit. I have been looking around and I think I have to develop/port it to Objective C using the iPhone Development Kit. My questions are:
Would this be easy to port?
Can I install the Development Kit on Windows, or Linux (I do not have a Mac).
Is there an alternative way (shortcut) to maybe emulate Linux binaries on the iPhone?
I have not tried anything yet, because I would like to know first what you guys think. You do not have to tell me exactly what to do, but I would highly appreciate if you would point me in the right direction.
Thanks.

Well, if you don't want to port your program into another language. You CAN use SDL2, it seems pretty stable and it works on iOS (iPhone/iPad/iPod Touch). All you would have to do is change your code and then play around with the controls. You'll have to clone the Mercurial repo from http://hg.libsdl.org/. It will come with a README.iOS file, in which describes how the port works and some other details. I am not sure if it has multi-touch support yet, I have not tested it.
Also, you can use immediate mode on the iPhone, you just can't use OpenGL ES 2 if you do that. All you have to do is make a context for OpenGL ES 1.1.
And you WILL need a Mac, or perhaps you could get a Hackintosh to compile your code and then run it with a jailbroken iPod/iPhone/iPad.
NOTE:
I believe I have heard of some people compiling their code on a Hackintosh and then submitting it to the app store from a Mac within an Apple store.

Related

Force Unreal Engine to use opengl on windows executable

I'm attempting to make a video game in Unreal Engine 4.9. I'm building it for Windows, but I'd like to have it use opengl instead of directx in the executable. However, I've found no options that let you do this. Unreal Engine uses OpenGL when it creates executables for Linux and Mac, but there seems to be no way to use OpenGL with Windows.
Am I missing something? Is there some way to force Unreal Engine to use OpenGL in Windows executables?
EDIT: The reason I want to use OpenGL is because I want this game to run without having to install anything on the end user's computer (DirectX has to be installed to work)
Microsoft doesn't really support OpenGL, they typically go out of their way to make it very difficult to use OpenGL on Windows and strongly encourage people to use DirectX instead.
The simplest way to get a working OpenGL context in windows is sometimes to use ANGLE which is a compatibility layer which translates OpenGL calls to DirectX calls. This is what Chrome and Firefox use to support WebGL on windows. I doubt that Unreal Engine is integrated with this, so you might have a hard time.
Edit:
EDIT: The reason I want to use OpenGL is because I want this game to run without having to install anything on the end user's computer (DirectX has to be installed to work)
One thing you could do is cross-compile the Mesa3D drivers, as described here: https://wiki.qt.io/Cross_compiling_Mesa_for_Windows
But then you won't get hardware acceleration.

SDL - Cross platform development

I'm going to enter a small game competition in the coming months. They require the submission to be able to be compiled ( and it will be, before being run/evaluated for the contest) on Linux. I'm going to be using SDL and C++. I've only ever developed on Windows before and I've grown quite accustomed to the benefits Visual Studio gives. I'd like to be able to develop in windows with VS, and then near the end of the process migrate it over to linux. Beside making sure SDL is already installed on the Linux machine, are there things I can do throughout development that will make the process easier? Also, the contest rule for all of this states:
it must also work on an open platform (we strongly recommend making sure that your program run on modern flavors of GNU/Linux, as all of the judges will have access to it).
I assume compiling/running in Ubuntu (already have a home server with this) would be sufficient for this?
Your question is slightly open-ended, but my first suggestion would be to use a proper cross-platform build system such as CMake from day one. I would refrain from "migrating" to Linux at the very end; you may be under a rough schedule (and maybe run into problems you did not anticipate). Thus, a continuous build of (working) Linux versions will help ease your worries.
Furthermore, if the game is meant to run solely under Linux, why not install Ubuntu in a Virtual Machine somewhere and get acquainted with one of the development environments such as kdevelop or qtcreator? Wouldn't direct contact with the platform you are developing for make things a little easier?
I'm developing games and started like you. I'd advise you to use SFML library for this purposes. It's not very big and is very good thing to start from.
There you can use:
2D renderer (OpenGL)
Fonts
Timers
Wrappers around images/sprites
Post effects/shaders
Sound
Network
In this page you can find a few start examples.

GUI Programming C++ for Mac OS X Lion

I'm probably going to get abuse for this question but here goes. Oh but before you tear into me and tell to crawl back under a rock etc. I have looked high and low and nothing has helped me so far either the software libs are out of date and for some reason wont work on lion.
Ok other than Qt is there any other lightweight opensource GUI library for C++ on mac? I have tried this wxWidgets doesn't work for some reason. Apple don't seem to offer that carbon crap anymore or can I use openGL to create GUI's? I just want a simple nicely documented GUI lib without having to switch to windows to develop. or will I have to spend some money on one or resort to Qt.
Hope someone can help and thanks!
Why not use Cocoa (the native way to develop OSX GUIs) in the first place? You must use the Objective-C calls to create windows for example, but you can mix this code with C++ code in the same file - this is then called Objective-C++ and it is supported by clang and the gcc.
To build completely native-looking OSX Applications, you need Cocoa. Every other toolkit that can create those native GUIs calls Cocoa (at least to my knowledge).
Just as a pointer: have you tried SDL?
FLTK is simple and very stable GUI library. Runs on Windows, OS X and Linux.
Non-native look though.
Here is a screenshot of an app I built with it a few years ago, and that still runs great on Lion.
I'd take a look at both GLUT and GLUI as simple extensions to OpenGL that provide basic widgets. They can be used together to some degree, but I personally have run into a couple issues in that department. Either one in isolation is pretty simple to use if you're familiar with OpenGL though.
EDIT: Also, X11 can run in OS X, although I'm not familiar enough with the system to know how to get started with that.

Cross platform c++ with libcurl

I am a perl developer that has never went into the client side programming of things. I'd like to think that I'm a pretty good developer, except I know that my severe lack of knowledge of the way desktop programming really takes away from my credibility.
That said, I really want to get into doing some desktop applications.
I want to try to develop a simple application that will connect to my server and grab an rss feed, then display it in the console. My plan of attack is to use libcurl (and curlpp) to grab the feed (I'd also like to do more curl stuff in the future). But I want to be able to run this small program on linux, windows, and mac because I want to understand developing cross platform.
So here is the question (and I know it is extremely noobish): How do I write c++ code that will use libcurl and curlpp, and will work on the 3 major OSes? The main thing I don't understand is if I have to compile libcurl and curlpp, then how does it work when trying to take it over to the other platforms?
You need to write the code portably - basically make it a console application. You then transfer the source code (not the exe) to the other platforms and compile it there and link with the version of llibcurl on each specific platform.
Neil is right, but using a framework will make your life easier. Try QT it is very nice. It has a cross platform http API, and integrates curl.
I'd recommend Qt4 as well, I've wrote a small'ish tutorial on how to setup a windows gcc compiler on linux and compile Qt4/OpenSSL with it for windows, hope that helps.
http://www.limitlessfx.com/mingw-openssl-qt4-for-windows-on-linux.html
You can easily adapt that tutorial to compiling libcurl instead of just moving to Qt4.

How to get started with Maemo software development [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
A few months ego I purchased Nokia N800 device and since then I'm itching to write some code for it. I know that some of the application I'm running are written in Python and that there is a Mono port for the Maemo platform as well.
Basically what I'm asking is:
Is there a recommended development language for Maemo platform?
What development tools exist?
Can I use Windows or Linux as my primary development machine, and which do you recommend and why?
I highly suggest that you try C++ and QT.
QT is already well supported for Diablo and Fremantle, and the next release of Maemo (Harmattan) should be based on QT.
Learning QT will be much much easier than GTK+, coding will be faster and more fun, your application can be compiled in various platforms and you can even develop and debug in Windows, then simply run a qmake && make in a scratchbox environment.
Take a look at this tutorial: Getting started wit QT for Maemo
You still need a Linux box to compile your code for a Maemo device.
If you are using windows, you can setup ubuntu (or kubuntu) in a VirtualBox machine.
Maemo SDk + along with Scratchbox 2 is a better alternative than Maemo SDk & Scratchbox.
Personnally, I'm using QT creator in Windows, kubuntu 9.04 in VirtualBox, and I've never been happier.
When I started, I tried the "official" approach : Ubuntu, GTK+, C language and scratchbox 1. ... that was painful.
The Hildon framework is made up of GTK+ extensions, so the language is C. You can use C++ wrappers (maemomm) too. Or you can go with pymaemo for building apps with Python, which to me is much easier than C or C++. I've also seen an attempt at a ruby port, but have not followed up with that project recently.
For the development environment, there is "scratchbox", which gives you a sandbox for compiling and running your app. Here's a link on how to set up a scratchbox development environment. (It sure took me a long time to get everything setup.)
You'll have to use Linux as your development machine because your Nokia N800 is really a mini Linux computer.
If you want to have an IDE experience, try the ESbox plugin for Eclipse.
Have fun hacking!!!
I've just found two tutorials on Maemo.org:
Writing Hildon Desktop Plug-ins for Maemo 3.x
How to write maemo desktop plugins for maemo 4.x
For extra on-the-go fun, you can get the linux gcc and make tools running on the tablet itself and do your programming and compiling on the device.
For any help with this sort of stuff the Maemo Talk forums are fantastic.
Ruby for Maemo is being hosted at http://code.scottishclimbs.com/maemo/
I've not yet tried it myself.
There's a Scratchbox Virtual Appliance for Maemo development (I'm not sure if the link is the right one) but that's how I started hacking. It took forever for me to figure out how to set up scratchbox by myself.
I have to echo Karatchov's response.
The 2 recommended approaches currently are:
Python + PyGtk
C++ & Qt
Using anything else, you set yourself up for some pain (unless you are a Gtk+ veteran - since you are asking this question, I assume you are not). C++ & Qt is the future of Maemo anyway, and Qt works well on "old" platforms such as Diablo.
As a debugger, I recommend you pick up (compile) "cgdb". The plain old gdb can be a bit too spartan.
Generally, you should develop your application as a "normal" Qt application using Qt Creator, and occasionally test it in scratchbox.
Nokia has been working hard to provide tools and documentation for developers. I would say one of the best places to start is at Forum Nokia:
http://www.forum.nokia.com/Technology_Topics/Device_Platforms/Maemo.xhtml
The next stop for developing for Maemo is of course Maemo's headquarters:
http://maemo.org/development/
These two links are to portals where you'll have to drill down for further info, but they are pretty good starting points. Now to answer your questions directly:
I suppose the two 'recommended' languages are C and python. While these are well supported, they are not the only choices as you have seen from previous answers. In addition to those languages, perl is on the device, though it is not in the same state as it is on debian.
The chief development tool is the SDK. It allows you to test the environment and compile software for the device. You can also use Eclipse for which there are plugins.
It is recommended that you use linux as a development machine, but you can run it in a virtual machine on Windows. While I prefer my OS to be 100% free and therefor choose debian, Nokia is working hard to make a better development environment for Windows. So rest assured that Nokia does not necessarily share my bias! :-)
I develop mainly with python and pyside (I develop on an N900).
I have all my files in the nokia N900 and I use sshfs to mount my home directory on my pc.
I then develop on my desktop, while actually saving everything right into the cell phone, and use SSH to run it remotely.
If you get too lazy to even pick up the device to look at the screen, you might want to use VNC; though personally, I feel it's just not responsive enough.
Yes, all I have on my desktop is my editor (sublime-text, by the way). The rest live on the mobile device. I use git to sync things/make backups, etc.
py2deb is great for making packages once you want to distribute your proyect. Again, no need to install anything on your desktop.
IF you'd rather be more conservative, the SDK is designed for debian, and you'll suffer a lot with any non-debian-based OS (unless you use a VM). Be warned! :)