I am reading a book about iPhone game development, it uses some functions start with 'gl' and ends with 'OES'.
like this:
glGetRenderbufferParameterivOES
Where can I get reference of these functions?
you can find the man pages for OpenGL ES on the Khronos website:
http://www.khronos.org/opengles/sdk/docs/man/
As far as I know the OES extension was removed as of OpenGL ES 2.0.
Hope this helps.
http://www.khronos.org/opengles/sdk/docs/man/
In your case http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetRenderbufferParameteriv.xml
The OES suffix just marks it as being specific to OpenGL-ES (OES).
Related
I am new to iOS development and apologies for a basic question. I am trying to convert an image to grayscaled and threshold it using openCV in iOS. So far, I have imported and setup the framework on xcode. What I am trying to do now is to implement the following features:
http://www.youtube.com/watch?feature=player_embedded&v=Ko3K_xdhJ1I
at 0:24 and 0:53
I tried to follow the tutorial which points to the above youtube video :
http://docs.opencv.org/doc/tutorials/ios/image_manipulation/image_manipulation.html
and wasn't sure where to paste the above code and in which file?
Many thanks.
Kind Regards.
These are helper methods and best written in a separate file. Quite simply,
http://answers.oreilly.com/topic/631-how-to-get-c-and-objective-c-to-play-nicely-in-xcode/
Put all that image manipulation code in say ImageManipulationHelper.mm and create a header file for the same
Create a nice little category for UIImage.
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html
which can call these methods in turn to create any image manipulation you might want.
Easy does it. And yeah, read up a bit more on using C++ in objectiveC, if you get into trouble and also about categories. They are some of the niftier features of objectivec
I achieved the same,using the help of this awesome link
Let me know if you need any further help.
Cheers!!
Edit :
Check this out ImageFiltering
In Unity, Wen can call objective-C code from C# by import the function of objective-C as extern function.
But how call C# script code from objective-C ?
You can use
UnitySendMessage("GameObjectName1", "MethodName1", "Message to send");
in which you fill your gameobject name which will receive this message and the message name.
You can implement your own delegate/event once you receive this message from native code. The limit of UnitySendMessage is when it arrives to Unity code, it is always 1 frame after you call this in native code. And it can only take string as parameter. But most of time it is not big problem.
The method to be used for this is UnitySendMessage. Have a look at Building Plugins for iOS or this blog which is partially written in Chinese.
Have a look at: http://www.tinytimgames.com/2010/01/10/the-unityobjective-c-divide/
The bolg post shows a technique that uses KVO (Key Value Observation) and the PlayerPrefs to pass commands from unity to objective-c.
PlayerPrefs.SetString("Commands",
String.Format("AwesomeCommand|{0}|{1}", awesome1, awesome2));
Turns out you can create a callback method that will allow you to do whatever you want.
Here is an example video showing it being done for OSX, but the C++ code is cross platform.
This guy has been doing videos on plugins for all the operating systems, but the mac one is the coolest so far, since it gives you function pointers to C# code.
http://www.youtube.com/watch?v=Q2dDK0ulDYY
Universal plugin for unity for iOS that allow mixing C# with objective-C
http://goo.gl/XDrQFh
Unity C#
var callbackClass = AKiOSMagic.CreateClass("MyCallbackClass", "NSObject");
callbackClass.AddMethod("methodWithArg:anotherArg:", (args)
{
// do something...
// args.GetObject(0);
// args.GetObject(1);
});
callbackClass.RegisterClass();
Objective-C
[[NSClassFromString(#"MyCallbackClass") new] methodWithArg:#"arg1" anotherArg:#"arg2"]
I am getting really desperate here. I working with Xcode, trying to implement some OpenGL stuff on the iPhone. I have to write a Shader for Phong-Lighting. I got as far as declaring my geometry (vertices, indices, calculating etc.) and passing the respective arguments as attributes to the shader (written in GLSL). Using these attributes works fine, some really basic shader programs compile correctly and give the expected output.
Now I'm trying to start with some more advanced calculations, for which I need to use some of the built-in attributes of GLSL, namely i.e. the "gl_NormalMatrix", but whenever I try that, the program crashes and I get an "ERROR: 0:3: Use of undeclared identifier 'gl_NormalMatrix'".
It happens identically whenever use any of the built-in attributes such as gl_Vertex, gl_Normal etc.
Are these attributes not available in GLSL on the iPhone or am I missing something? Maybe I haven't fully understood how this works. As mentioned, passing my own vertex attributes into the shader works fine, and I am also wondering how the program should "know" the correct values "on its own" - so the whole concept of built-in attributes is still a bit confusing to me. But whenever I try to run some shaders I found online to see if something happens, I get these errors thrown, even though everyone else seems to use built-in attributes extensively when writing shaders.
I really hope someone here can shed some light on this. Thousand thanks in advance!
Julia
Those attributes aren't available in GL ES, whether on the iPhone or elsewhere. And the same goes for WebGL. You need to write your own matrix code, or use GLKit if you're supporting only iOS 5+, and supply attributes for yourself. See Kronos' reference card for an incredibly concise summary of what made it into ES 2.0 — amongst other things it lists all the available built-in special variables as:
gl_Position
gl_PointSize
gl_FragCoord
gl_FrontFacing
gl_PointCoord
gl_FragColor
gl_FragData[n]
GLKit's maths stuff is really good because it inlines and uses the ARM's NEON SIMD unit. I consider it a sufficient reason to specify iOS 5 as a minimum in all new GL projects.
is there any complete source code available for developing a image editing,paintng application in iphone???if anyone knows plese help me
thankzz
GLPaint, available from Apple...
http://developer.apple.com/library/ios/#samplecode/GLPaint/Introduction/Intro.html%23//apple_ref/doc/uid/DTS40007328-Intro-DontLinkElementID_2
Berkeley had a hw assignment. Students submitted them via wiki so maybe look at those?
http://vis.berkeley.edu/courses/cs160-sp10/wiki/index.php/Individual_Programming_Assignment_3
There is an application named TouchPainter and its source code is available. It contains drawing, color blending, Undo/Redo (Amazing..!!), Save/Open drawings..
Note : It may require very deep level knowledge of Objective C. The whole application's source code is explained in this book "Apress.Pro.Objective-C.Design.Patterns.for.iOS.Mar.2010" available and source code is also available here :
http://www.apress.com/apple-mac/objective-c/9781430233305
I hope it will be helpful to you.. :) Good luck..
I'm using OpenGL ES 1.1 on the iPhone, and I'd like to use the following functions:
glBlendFuncSeparate
glBlendColor
With their related constants. These didn't exist in early iPhone GL implementations, but according to this page:
http://developer.apple.com/iphone/library/releasenotes/General/iPhone30APIDiffs/index.html
they should be there in 3.0+, which I'm building for. But I'm getting "implicit definition" warnings. What do I need to do to get those functions?
Thanks!
These functions are only defined for OpenGL ES 2.0. glBlendFuncSeparate does have a 1.1 extension version as glBlendFuncSeparateOES, but there is no equivalent for glBlendColor.
Extensions are included in the glext.h header files. Specifically, #include <OpenGLES/ES1/glext.h>