CocosSharp - using device camera as a game background - cocos2d-iphone

I am currently going through some game cross-platform frameworks and I really like the sound and look for CocosSharp.
However I haven't been able to find out if it is possible to use device camera in the game itself. In my case I would like to use whatever the device camera is seeing to project as a background to my game.
Is this possible with CocosSharp? If so, would anyone be able to point me to a code snippet / which class to work with?

Related

Emulate mouse in ALL directX games

I want to emulate mouse movement using C++ code inside directX games.
I know that we cannot use setCursorPos since inside the game the cursor position stays fixed.
I tried making an HID using arduino controller but that only moves mouse in integer values and does not give smooth transitions.
So I want to do that at kernel level wherein I can take external inputs from a controller and move mouse inside all of the existing directX games as though the game is reading HID signal itself.
This is my problem statement however I don't know how to go about solving this.
I found a few similar questions simulate mouse click in DirectX game, DirectX Game Hook , Hook/OverLay a directX game where DirectX hook implementation was asked but no implementable answers were provided.
I tried using the GlovePIE application but that did not work when I tried it inside a game. I tried it with GTA V and COD.
So basically my question is how do I emulate mouse through a C++ code inside a DirectX game.

OpenGL - Display video a stream of the desktop on Windows

So I am trying to figure out how get a video feed (or screenshot feed if I must) of the Desktop using OpenGL in Windows and display that in a 3D environment. I plan to integrate this with ARToolkit to make essentially a virtual screen. The only issue is that I have tried manually getting the pixels in OpenGl, but I have been unable to properly display them in a 3D environment?
I apologize in advance that I do not have minimum runnable code, but due to all the dependencies and whatnot trying to get an ARToolkit code running would be far from minimal. How would I capture the desktop on Windows and display it in ARToolkit?
BONUS: If you can grab each desktop from the 'virtual' desktops in Windows 10, that would be an excellent bonus!
Alternative: If you know another AR library that renders differently, or allows me to achieve the same effect, I would be grateful.
There are 2 different problems here:
a) Make an augmentation that plays video
b) Stream the desktop to somewhere else
For playing video on an augmentation you basically need to have a texture that gets updated on each frame. I recall that ARToolkit for Unity has an example that plays video.However.
Streaming the desktop to the other device is a problem of its own. There are tools that do screen recording, but you probably don't want that.
It sounds to me that what you want to do it to make a VLC viewer and put that into an augmentation. If I am correct, I suggest you to start by looking at existing open source VLC viewers.

Achieve Infinite Scrolling for a platformer game using cocos2d language objective c

I am trying to develop an 2D game using cocos2d library. I am still learning the framework.
Please understand that I am new to game development but not new to programming using objective c.
Here is the issue I am facing when it comes to my game development effort - I feel that I am missing the theoretical understanding of how to develop an infinite scrolling game. Is it possible for any of you to provide me some guidance on that ?
Here is my understanding of achieving infinite scrolling using cocos2d framework:
Cocos2d has a singleton director class which handles the current scene and scene transitions
In the current scene, I feel like I have to create an platform object consisting of several images and add them as a child to the current layer. And constantly run a move action to the platform sprite. So as and when I detect a particular image is off screen I have to replace it with another image. That way I will be able to create an infinite scrolling.
I am sorry if point 2 is not coherent. I just attempted to put my understanding of how to infinite scrolling.
Can you please help me with this ?
Thanks
I dissected how to implement scrolling with cocos2d-iphone in this article. What you probably want is the "fake scrolling" approach where two background images are moved and switch position after one completely left the screen.
You want to do this for the background layer only, not individual sprites. Your world isn't really moving, it's just the background panning that creates the illusion of movement. All sprites etc (player, enemies) movement is still relative to screen coordinates.
You'll find a working implementation in the code for my Learn Cocos2D 2 book in the Shoot'em Up project.
If you don't want to bother implementing this yourself, KoboldTouch supports endless/infinite scrolling for tilemaps. Here the game objects actually move along with the background infinitely (up to the maximum coordinates supported by float which is around +/- 16 million points).

OpenGL Window Overlay

What I need to do is create a program that overlays the whole screen and every 30 seconds the screen needs to flash black once.
the program just needs to be on top of everything, doesn't have to work over the top of games, but wouldn't say no if it did!
But i've got no idea where to start. Ideally the solution would be cross-platform for both windows and osx.
Does anybody have any ideas about where I should start or could whip up a quick demo?
OpenGL (you tagged it as such) will not help you with this.
Create a program, that overlays the whole screen,
The canonical way to do this is by creating a decorationless, borderless top level window with some stay-on-top property being set.
and every 30 seconds the screen needs to flash black once.
How do you define "flash back once"? You mean you want the display become visible for one single vertical retrace period or a given amount of time? Being the electronics tinkerer I am, honestly, I'd do this using a handfull of transistors, resistors and capacitors, blanking the analog VGA signal.
Anyway, if you want to do this using software, this is going to be hard work. If you'd do this using the aforementioned stay-on-top window, when you "flash" it away, all the programs with visible output would receive redraw events, which to process would take some time. In the best case scenario the system uses a compositing window manager which can practically immediately show the desktop. Without a compositor its going to be impossible to "flash" the screen.
Ideally the solution would be cross-platform for both windows and osx
A task like this can not be solved cross plattform. There's too much OS dependent work to do for this.
I presume this is for some kind of nerological or psychological experiment. I think doing this using some VGA intercepting circurity would be actually the easier, quicker to implement solution. I can help you with that. But I think there's another StackExchange better suited for this. Unfortunately digital display interfaces (DVI, HDMI and Display Port) use a complex line code scheme, which can not be blanked as easily as VGA, so you must have a computer capable of analog (=VGA) output and a display with a VGA input.

Restricting type of Camera in 'change camera" button in CameraCaptureUI

CameraCaptureUI is a easy way to capture,record video from the camera.
I am Working on Camera App where I use only particular camera say for example, Only Logitech camera be displayed. So when the user press 'change camera" In UI, it will only switch between Logitech camera not others.
I can do it using Media Capture UI.I wanted to know whether it is possible through CameraCapture UI Api or not Since this will reduce the development time.
I am using C++ as programming language.
It does not seem to be an option on the CameraCaptureUI - it really is pretty simplified. If you are going with the MediaCapture/CaptureElement route - you might want to check the CameraCaptureControl in the WinRT XAML Toolkit. It is C# code, but it has some things figured out for controlling the cameras.