Just you know, I'm just starting with iOs and Objective-C (3days).
I'm currently making a 3D object viewer.
I want to be able to load a file and display it into a view. Then the user can rotates and zooms on it.
I have first build it with ninevehGL, but it appears that It doesn't support heavy files (>10M) so well.
I'm now trying to go for Cocos3D.
After i installed everything I have created a xcode project using the cocos3D 2.0 template.
This template should display (i guess) a 3D text "hello world".
But it doesn't even compile throwing me the following:
-(void) updateBounds: (CGRect) bounds withDeviceOrientation: (ccDeviceOrientation) deviceOrientation; <---- expected as a type
It appears that (ccDeviceOrientation) is not recognized as a type.
Would you help me with this ?
I have the project on gitHub here under the folder COCOS3D
Also I'm using the followings version of cocos
cocos2D: 2.0.0 8-Jul-2012
cocos3D: cocos3d 0.7.0
I have, at the same time, posted my question on cocos2D forum, Bill Hollings has been kind enough the quickly reply, and pointed me that the versions of cocos2D and cocos3D i use can't work together.
Here is the explanation and what to do.
Related
I try to access frames of RTCVideoRenderer without success, can you help me please ?
I noticed that there is a "didCaptureVideoFrame" method in RTCVideoCapturerDelegate, but not in RTCVideoViewDelegate.
I have never done objc, I added a method in RTCVideoViewDelegate to get frames (bellow "didChangeVideoSize"), but it do not get fired, I guess it do not work like that.
I am able to access frames from the remote using Android using the "onFrame" of VideoSink, I thought it would be that easy using ios.
PS: To add the method, I took the framework from the pod and put it in the project, because I noticed that when you modify a pod, changes do not apply.
Here is the line I added :
- (void)videoView:(id<RTCVideoRenderer>)videoView didRenderVideoFrame:(RTCVideoFrame *)frame;
I will now try to compile the library with the changes I want.
EDIT:
I am now compiling the library, I noticed the need to change several files to be able to access frames, it will not be done just by adding 10 lines.
Solved thanks to this : How to get frame data in AppRTC iOS app for video modifications?
I used this line instead (because names changed since) :
#property(atomic, strong) RTCVideoFrame* videoFrame;
I wanted a "onFrame" like VideoSink on Android, but it will be ok for now.
As used in DebugHitTestBounder in SampleApp; I have subclassed SkBounder and installed in my canvas (created in each draw) in order to find what is drawn under mouse clicks but the onIRect method is never called by the drawing routines. The commit method is called as expected (but I don't need it, I need one with a display-space converted rectangle parameter). I debugged the code, found out draw loops are managed in canvas.cpp in one place with macros (LOOPER_BEGIN and LOOPER_END) and found no place in the drawing calls that calls bounder's onIRect. Am I doing something wrong?
Note: I am using code from 2 months old master branch of git repo with XCode 4.6 in Mac OS 10.8.x. Project files are created via gyp.
Apparently, SkBounder only works on the raster backend, I was using the accelerated (GL) backend.
i'm actually trying to do a launcher of cocos2d game in Objective C (for an iOS app).
But i'm having a lot of errors, and don't really know C++ well (there is lot C++ code in the cocos2d game, which I didn't create).
To describe how I integrated the game (maybe did mistakes) :
Add the xcodeproj of cocos game in my application
Add the cocos as a target dependancy.
In build settings, set Always search user path to "YES".
Change "Compile source as" in "Objective-C++"
Add .mm extensions to files which will call the cocos2d game functions.
Are all this steps necessary ?
I now getting new errors in my code, like :
return [self drawInRect:rect withZFont:font lineBreakMode:lineBreakMode alignment:UITextAlignmentLeft];
"Cannot initialize a parameter of type "UITextAlignment" (aka 'NSTextAlignment") with an rvalue of type 'anonymous enum at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h:40:1>.
So I should cast the value, but I don't really want to change all my previous code to make it works..
Is there a way to avoid that?
And is there some steps I missed in the integration, or maybe future advices :).
Thanks in advance.
First things first: Platform is Windows 7 64-bit, language is VC++, IDE is VS2010. Graphics card is nVidia GTX 460, drivers are version 290.53.
So here's the situation. I am currently working in OpenGL using Glew 1.7 and Glut. I set everything up a few days ago and managed to successfully code and complete an assignment for my classes. The assignment ran beautifully and displayed and did everything it was supposed to. That was wonderful. So I submitted my assignment and didn't touch it again until tonight.
Now, tonight I tried running the code again and instead of my beautifully tessellated polygons I am getting a plain white window. As far as I know, nothing related to OpenGL has changed on my system since I last ran the code. I haven't changed the code at all, I haven't changed the graphics drivers, I haven't changed anything that I am aware of. I couldn't seem to find anything related to this kind of problem, and I am at a loss of what could possibly be causing the issue. I even tried recompiling Glew, but it didn't change anything. I know it's not a code issue since it was working fine a few days ago and nothing has changed, so it has to be a configuration issue.
Could someone please point me in the right direction?
Edit
One more thing to add to this. When I was originally doing the project in question, attempting to run it produced the error message "unable to find glew32d.dll" until I placed glew32d.dll and glut32.dll in the source folder of my project.
Now, I don't remember deleting them from my project folder, but when I tried to debug it last night, I noticed that both of them had disappeared from my project folder. However, I was not getting any .dll missing errors. Replacing them in the folder didn't solve the problem, but I am wondering if their disappearance has something to do with this. They are also located in the VC/bin/ directory of the VS2010 install path, and deleting them from both locations produces the error message, but having them in either location is now sufficient for building and running when previously I needed them in both.
One possibility is that you're scaling by an infinite value (1.#INF), or something of the sort. I've run into a very similar situation, and that turned out to be the problem. However, if you have not changed the code, then you may be able to rule this out. Have you tried throwing in some code to render a simple quad or triangle to the screen?
As for the .dlls, I recommend putting them in your C:/Windows/SysWOW64 and C:/Windows/System32 folders. SysWOW64 specifically houses all the 32-bit .dlls, but it's safe to put them in both locations. Visual Studio will look in both your project folder and these system folders for necessary dynamic libraries. The advantage of placing them in the system folders is that they are then available for all OpenGL applications you may write.
One last thing that might help in finding the issue is making use of OpenGL's error reporting. You can use a function such as:
void HandleGLError()
{
GLenum error;
int i = 0;
while ((error = glGetError()) != GL_NO_ERROR) {
printf("GL ERROR(%d) %s\n",i,gluErrorString(error));
i++;
}
}
Try calling that at the beginning and end of your render function, and in any other places you think might be causing a problem.
I'm currently trying to re-write my binder between Ogre and SDL in my game engine. Originally I used the method outlined in the Ogre Wiki here. I recently updated my version of SDL to 1.3 and noticed the "SDL_CreateWindowFrom()" function call and re-implemented my binder to allow Ogre to build the window, and then get the HWND from Ogre to be passed into SDL.
Only one window is made and I see everything renders properly, however no input is collected. I have no idea why. Here's the code I am currently working with (on windows):
OgreWindow = Ogre::Root::getSingleton().createRenderWindow(WindowCaption, Settings.RenderWidth, Settings.RenderHeight, Settings.Fullscreen, &Opts);
size_t Data = 0;
OgreWindow->getCustomAttribute("WINDOW",&Data);
SDLWindow = SDL_CreateWindowFrom(&Data);
SDL_SetWindowGrab(SDLWindow,SDL_TRUE);
I've tried looking around and there are a number of people that have done this to one degree of success or another(such as here or here). But no one seems to comment on handling the input after implementing this.
I originally thought that maybe since SDL does not own the window it wouldn't collect input from it by default, which is reasonable. So I searched the SDL API and only found that one function "SDL_SetWindowGrab()" that seems to relate to input capture. But calling that has no effect.
How can I get SDL to collect input from my Ogre-made window?
It has been a while, but I figured I would put in the answer for others that may need it. It turned out to be a bug/incomplete feature in SDL 1.3. The "CreateWindowFrom" method wasn't originally intended to be used exclusively as an input handler. At the time of this writing I know myself and another on my team wrote patches for Windows and Linux that permitted this use to work and submitted those patches to SDL.