Cococs2d and Arc - cocos2d-iphone

I've just begun developing with Cocos2d for iPhone. And I've realized that there was no "Use Automatic Reference Counting" check box when creating a new project with a Cocos2d template. My Xcode is 4.3.1, iOS 5. Can I still omit retains and releases or do I have to go old style?

You have to enable ARC under Build Settings before you can use it. For cocos2d you need at least v1.0.1 (with possibly some manual fixes) or v1.1 or v2.0. Then follow my tutorial about enabling ARC in a cocos2d project.
You could also just use Kobold2D for cocos2d development. ARC is already enabled in all template projects.

Related

OS X fullscreen in wxWidgets 3.0

I contribute to a cross-platform application which is built using wxWidgets stable version - 3.0.2.
I would like to enable the app to use the native fullscreen system on OS X Lion and above. This feature is implemented in current development versions of wxWidgets, but not in 3.0.2.
I understand that it should be possible to call the native Cocoa API from within the wxWidgets app to enable fullscreen mode, but I can't work out how to do so and can't find any information online.
How can I directly access the NSWindow class from my wxWidgets C++ code?
For reference, this question asks how to do the same with wxPython, and gets an answer - but python is different enough from C++ that I can't work out how I would do it in standard wxWidgets.
You can use wxWindow::MacGetTopLevelWindowRef() to get the NSWindow. See this commit for what you can do with it afterwards.

Qt C++ Library for Windows and OpenGL

I am trying to experiment with the Qt library on Windows. On their downloads page, I notice that the binaries built using VS2012 are available in two forms, with and without OpenGL. What exactly is the difference between the two? In the OpenGL version, do they have some special API implemented using OpenGL or does all of Qt rendering depend on OpenGL? Also, is there a version of Qt that uses DirectX?
#Raman: The opengl variant is using the desktop opengl version just like with Qt4.
The non-opengl variant is using angle, and you need to have that installed alongside the DirectX SDK to get it working. Angle is an adapter between the directx and the opengles API. Only the latter is support directly by Qt, but unfortunately directx drivers tend to work better on Windows than the opengl(es) ones. There are no plans to support a directx backend inside Qt, so we leave with Google's Angle work in that regard.
As for providing some extra bit, there was a discussion about it recently on the mailing list, that this decision should not be build time, but more like run time. However, no one has stood up just yet to make that work. Hopefully, that will change soon. It is causing confusion for the end users just like, so do not feel alone. ;-)
Hope this explanation helps.
DirectX is supported via the ANGLE based library.
Note that this has changed and as of Qt 5.5 the prebuilt binaries you can download from the Qt website are configured with the -opengl dynamic option. This is what #lpapp above was talking about. Qt defaults to choosing either native OpenGL drivers or ANGLE at run time now.
Qt internally uses OpenGL to render unless you specify otherwise now. You can also render custom OpenGL content using Qt's QOpenGLxxx functions and classes.
For a simple introduction to Qt and OpenGL that covers this and more click here.

Qt 4.x/5.x and OpenGL for Desktop Gui application: What module to choose?

I am starting a new GUI application project using Qt and OpenGL for Linux/Windows desktops. My assumptions so far: use Qt GUI (C++ ... not QML/QtQuick 2) with OpenGL 4.1 or higher (requirement). After some reading, I am completely lost about what path to choose. What path will keep my application future-proof in term of support and libraries.
Qt 4.x or Qt 5.x?
Standard OpenGL or QGL or QOpenGL or QtOpenGL wrappers?
QWidget/QGLWidget (Qt 4.x) or QWindow (Qt 5.x)?
The application is intended to run in desktop environment and will do a lot of file (geometry) opening/saving, instanced 3D painting and some imaging. Could someone point me out to the best combination to choose with some explanation if possible?
Sean Harmer presentation on Qt 5 and OpenGL did answer some parts of my questions but I was a bit lost when he started using QML and QtQuick 2. I felt like QOpenGL was a lightweighted version to be used with QtQuick 2. Correct me If I am wrong on that please.
Qt 5.0 is still in beta, therefore if your project is serious, you should go with qt 4.8, because that is the latest stable release. However, if you must have some Qt 5.0 features, then you have no other choice but to go with 5.0.
Since you chosen Qt, you should stick to it. That means using QtOpenGL. That doesn't mean you are not going to use standard OpenGL. QtOpenGL provides you API to simplify some OpenGL calls, and make them more object oriented. After all, OpenGL is set of C functions, not set of c++ classes.

Kobold2d 2.0.4 SpaceManager library not updated

I am trying to use the spaceManager library but It won't even compile with the spaceManager 1.3. According to MobileBros the creator of spaceManager I need to update the spaceManager library because version 1.3 is not compatible with cocos2d 2.0. So I am just wondering how to go about doing that? I have already downloaded the latest version of SpaceManager so I just needed to know what the best way is to go about updating it.
The built-in spacemanager in Kobold2D 2.0.4 should work, it just doesn't rotate sprites.
If the new spacemanager version uses the exact same filenames (no new, removed or renamed files) you can just replace the existing spacemanager files with the newer version.
If not, you may have to add/remove the corresponding files to and from the Xcode project, specifically the chipmunk-spacemanager targets in the Kobold2D-Libraries project.
I'll include spacemanager 0.2 in the next release.

Can´t create iOS projects with Cocos 3D, only Mac projects

I install Cocos 2D and Cocos 3D.
I can create Cocos 2D projects, but I can´t create Cocos 3D projects.
I select Cocos 3D in iOS section, but the created project is for MAC.
Why ??
I can´t solve it.
Thanks!
Cocos3D is for Mac only, and it only works with cocos2d v1.x. It may not work with the very latest version v1.1 of cocos2d, so you might want to try the v1.0.1 stable version instead.
In any case you have to re-install the cocos2d & cocos3d templates if you used a different version.