How can I detect fullscreen change or exit with DXGI and SetFullScreenState(...) with Directx10? - directx

I didn't found the solution of the problem described below for days :
So, I need to know how to get the moment when my directx application has finished going fullscreen or windowed mode, especially when it has totally completed the process.
I read that I can use DXGI_STATUS_MODE_CHANGED or DXGI_STATUS_MODE_CHANGE_IN_PROGRESS return values, but I don't know which function I could use to get these values !
https://learn.microsoft.com/fr-fr/windows/desktop/direct3ddxgi/dxgi-status
(Thanks for you help)
For example, I used IDXGISwapChain::SetFullscreenState(true, nullptr)
It works and the application goes fullscreen, but I don't know how to get the moment when the rendering goes back (the moment when I can see my rendering back)

Related

How to stop Swift ARKit app from reverting SCN Technique, and world tracking issues

I am making an ARKit swift app, and have followed this post on how to apply a mirroring effect to the camera feed. However, I've run into a couple problems. First, the mirroring effect stops after a while. This often happens when the images I am searching for come into the frame, but also happens when looking at something totally unrelated. The camera simply reverts back to the default, unmirrored view, and does not go back to the SCNTechnique mirrored view.
I have been able to conclude that this is not happening when the anchors are placed in the world, since the code is not executing those lines when the mirroring effect reverts back. Is there a way to stop this from happening and make sure the mirroring SCNTechnique remains? I am unsure if this is simply a hardware limitation of the iPhone 11 that the app is running on, or if there is an issue with the code.
Also, whenever the image reverts from the mirrored effect to the default camera feed, the world tracking is severely screwed up. The coordinate axes that are placed in the view essentially just move around with the camera, and do not seem to be attached to any specific place. Is this related to the above issue, or would this be a separate problem with the code or implementation?

IOS Orientation fix doesn't work all the time

I am developping a swipe gallery for mobile devices. Users can change images by sliding the screen, as any normal images gallery in most iPhone app.
Here is a demo:
http://daviddarx.com/stuffs/work/custom/swip/
To debug the iOS orientation bug (which let the content zoomed when you change the orientation), I used the only library that correct that:
http://scottjehl.github.com/iOS-Orientationchange-Fix/
Unfortunately, this library is working perfectly most of the time, but it happens to fail and not work correctly. This happen around 1 time on 10 times, and the result is then the same as if the library wasn't here.
This is not a huge problem on most of the mobile and responsive website, as the user can manually dezoom and then get back to the normal display.
But the problem here is that I had to disable the zoom function, to make my system work correctly. So, when the bug happen, once on 10 times, the gallery is then just bugged and stay like that....
So, here are my questions:
-do you know any other library that manage that bug fix, and is 100% completely reliable?
-if not, do you know a way to correct the used library to get a 100% support rate?
-if not, do you have any idea or solution for me?
Thank you in advance for your help!
David
There's an outstanding pull request on Scott Jehl's repo that uses slope detection instead of absolute values which seems to not suffer from the intermittent-ness of the original solution.
https://github.com/PeterWooster/iOS-Orientationchange-Fix/

OpenGL iOS view does not paint

I am trying to use OpenGL to paint a view which is a subview of another view. I have created a view class for this purpose, and if I use this class in a simple test application it works fine. However, if I place an instance of this class on a particular page of my app, the OpenGL painting does not display anything. I am certain that the view is visible (I can set a background color, and that is displayed, and I can receive touch events). I can also trace through the OpenGL initialization and paint routines, and everything seems fine. My paint routine IS being called, and I call glGetError frequently and no errors are returned. I can compare tracing the routine with the case that works, and everything seems pretty much the same, but nothing paints (I even have simply tried doing nothing but clearing the window to black but that does nothing either).
The code for the app that does not work is far to complex to post here. I assume that I am doing something wrong, but for the life of me I cannot figure out what. Can anyone give me any ideas about why the OpenGL painting would appear to succeed and yet not draw anything, or suggest a strategy for figuring this out?
Thanks.
The link between OpenGL and the outside world is platform specific and not part of the core API. So a problem there wouldn't affect the result of glGetError.
In the case of iOS the relevant call is EAGLContext -presentRenderbuffer:, which will work provided you've used renderbufferStorage:fromDrawable: to create storage for a render buffer from a CAEAGLLayer. You probably want to inspect the return result of presentRenderbuffer: and the code around that to look for an error rather than the internal GL state.

iPad Limitations on Canvas Tag; Webpage Crashses on Canvas Tag Animation

Does anyone know if the iPad has any limitations on the canvas tag?
Currently I'm working on a creative that uses a flipbook and audio tag combination to simulate inline video content. The animations are drawn to the canvas element and synced with the audio content being played. There are 4 short video clips that get played when someone clicks on the four buttons below.
http://cs.sandbox.millennialmedia.com/~tkirchner/rich/K/kungfupanda2_test/
The problem I'm having though is in iPad. After playing a few animations, mobile safari just suddenly crashes. It never happens when I play it on my iPhone but it happens every time on the iPad. Its not one particular animation either because if I click a different combination of buttons, the previous clip that it crashed on plays fine, and then it decides to crash on another clip.
I think the problem might have to do with the amount of memory Safari gives individual page views. I found a blog post that explains that problem pretty well.
http://roblaplaca.com/blog/2010/05/05/ipad-safari-image-limit-workaround/
According to that post, once mobile Safari reaches a particular threshold of memory, images begin to return blank. This is consistant with my finds so far. The iPad that I'm testing this all on is running iOS 3.2.1 (and before anyone tells me that I should just explain to my boss that nobody uses 3.X anymore, I tried... they still want me to investigate this). I borrowed a co-workers iPad running iOS 4.2.1 and that device didn't crash, but some of the images weren't being drawn to the canvas.
I'm pretty sure its a problem with the canvas tag too, because I tried experimenting with running the animation without drawing anything to the canvas element, and the page never crashed.
Thats why I think maybe its a limitation with Safari's support of the canvas tag. Of course, I'm open to anybody else's suggestions.
Feels kinda weird answering my own question again, buuuut I figured if anyone did a search on this kind of question, an answer would be helpful.
I believe my original hypothesis was correct. The total amount of images that the aniamtions were using was around 600+. I think the older iPad loaded as many as it could and then when it ran out of cache and the canvas tag was trying to draw images that weren't really there anymore, it crashed.
Eventually we ended up serving the ad to devices with iOS 4.2 and higher, since the problem didn't seem to occur on those newer devices. Plus, we compressed the image sizes further, so that helped reduce the amount of images we were storing into memory.
If anybody knows approximately what the cache threshold in iOS 4.2 or higher browsers are, I'd appreciate it if you commented. Just want to get an idea of how many KB of image data I can safely load.

Preventing screen grab within Delphi [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How can I prevent users from taking screenshots of my application window?
So far I have be able to stop the Prt Sc key press and able to clear the clipboard so that my application cannot be screen grab.
However as a test I tried used Corel PaintShop pro and an option it has is to import screen capture which is very different from screen grabbing using the clipboard and as I suspected my application did not stop this.
So I have found the following code at this site : http://www.bitwisemag.com/copy/delphi/delphi1.html
This uses a different way of grabbing what is on screen and I presume that Corels method is similar to this. Is there anyway of this method of screen grabbing from being used on my application.
Greg Hewgill - Cheers for this - I will read this post
to get a screenshot on Windows is trivial, eg GetWindowDC(NULL). The only way I can think of is similar to this answer: stackoverflow.com/questions/455623/… – Nick
Nick looks like the same post that Greg has mentioned - however cheers for your response
Why go to this trouble? People nowadays can simply take a photo with their phone and send that around? – Marjan Venema
That may be true Marjan but I am trying to stop spyware programs from click logging if that makes the matter clearer.
The only way I can think of is to use DirectX. When certain apps such as DVD players write to the screen using DirectX, Windows sees a black (not quite black, but close) rectangle where the video shows. Attemps to use PrintScr or GetWindowDC() return that black rectangle. High-end screen capture apps like Snag-It can use DirectX to render the image properly, but this would be a 99% solution for you, and as others have said, users can always take a photo anyway.

Resources