PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Cant run opengl on mac..

RapchikProgrammer · 28 Mar 2010, 13:12 UTC
Hey, i am unable to successfully build any opengl application either for the simulator or the iphone.. whenever i build it it crashes with the console showing:

malloc: *** error for object 0x40063b0: pointer being freed was not allocated


I have been able to build and run on simulator and on device the helloworld and fountain examples.. but the animated 3d example crashes with this error, and on stack it shows that its still on OnCoreEvent.. And the same error occurs in my project.. I am new to mac and xcode so maybe im doing something wrong, but i have followed the getting started guide step by step..

and if i try to use the latest 3.985 sdk it gives an invalid architecture error on lib gl plugin file in simulator build and it gives a unreferenced symbol _main in crt0.lib error on device build.. so i am using 3.97 i think i am not sure, its the sdk just before the iphone simulator and device sdks merged..

one more thing, the example projects dont seem to be correctly configured either for the iphone as the include path is C:/project/edge :S..
Hi,

We recommend re-creating your project. Also make sure the libraries and headers are used of the same EDGELIB version to prevent conflicts. With the merged libraries you can skip the multiple targets step of the tutorial and just add the required libraries to 'frameworks'.
RapchikProgrammer · 07 Apr 2010, 00:19 UTC
ok, i got this part working finally.. now changing orientation in the displayConfig does nothing.. the game runs perfectly on the n95 but the orientation remains portrait on the iphone..
Hi,

Unfortunately, rotating doesn't work on the iPhone like it does it Symbian. However, you can rotate the screen easily through OpenGL with:

Code:

//Change orientation for iPhone
#if defined (DEVICE_IPHONE)
glRotatef(90, 0, 0, 1);
glTranslatex(0, -320, 0);
#endif


Also, you need to convert your touch coordinates with:

Code:

#if defined(DEVICE_IPHONE)
int tmpx = x;
x = y;
y = screenheight - tmpx;
#endif


I hope this helps.