Fraps like functionality for Metro style applications under Windows 8 - c++

Tools like Fraps work with games based on OpenGL or DirectX but doesn't work with simple Windows 8 Metro style games like "Cut The Rope" or "Pirates Loves Daisies". Yes I know that "Cut The Rope" and "Pirates Loves Daisies" are using different technologies like JavaScript and HTML5 canvas but I'm really curious is it possible to build Fraps like tool for such games (some kind of canvas hack?). I would like to do 2 things:
1. Measure fps.
2. Capture screenshots.
I was reading articles about the whole Fraps concept and intercepting calls to DirectX but I'm not sure if its gonna work with Metro applications. Maybe I'm just wasting my time. I have 2 questions for you guys:
1. Do You think is it possible to build Fraps like tool that works with Metro style applications or games that are NOT using DirectX or OpenGL?
2. Does messing around with dxgi.dll (or other dll) could help somehow?
Thanks

Fraps is able to display the framerate because of hooks it has into DirectX. HTML apps do not provide access to this same information.
I've confirmed that the free program ScreenPresso (http://www.screenpresso.com/) can record Cut The Rope just fine.

Try Intel GPA (graphics performance analyzers)
http://software.intel.com/en-us/vcsource/tools/intel-gpa
Install it and then run the app.
There are a zillion options for graphs and stuff that I don't entirely understand (maybe it will be useful to you). If you want fps, just close the window; the program will continue running in the background.
There should be an icon in the lower right next to battery info and volume control. If you hover over it, it says your IP address. Right click on the icon for GPA and then select "Analyze Application" at the top.
A window will pop up with all the tile apps on the machine. Click on the app (don't double click) and click "run" in the bottom right.
The frame rate and resolution will be displayed in the upper left corner.
Tested and it works for Cut the Rope (I'm getting 58-60 fps). Hope this helps.

Related

SFML - Support Windows window-behaviour for borderless window

So I'm creating an application using SFML, which I want to be borderless, so no border style. I added the ability to move it around on the screen and am planning on adding the ability to scale the window, however, that made me realise there's just a bit more to this. When dragging any window (not mine) say to the top of the screen, windows kicks in and suggests the ability to scale it to full, or when you drag a window to the side of the screen windows, again, kicks in and suggests making it cover half your screen. And it does this on borderless applications like Google chrome, or Spotify as well. I could probably try and add this in myself, but it's obvious other applications dont implement it themselves as you can see windows actually doing it the way it visually shows it. So, how would I go ahead imlementing this? I'm using SFML 2.5.1 with C++.
I have tried looking through google and stackoverflow to see if anyone has had any similar issues, of which I couldn't find any, which could honestly have been me not knowing how exactly to phrase it.

Are VCL ListViews ListBox DBGrids full touch aware?

Since we have tablets with Windows 10 I have decided to use again Delphi XE7 and VCL to develop for this multitouch devices.
I have found ListView, ListBox and DBGrid seem not have a standard behavior with pan and scroll (just PanUp & PanDown, ScrollUp ScrollDown). DBGrid does not support touching panning. ListBox, seem doesn't control inertial panning like TListview... and ListView react erratically, sometimes "loose" pannings moving scrollbar but not items list.
Have someone tested this controls on Windows 8.1 or Windows 10 using a multitouch tablet ?. Just load components with, let me say 100 items and try to have a simple vertical smooth scroll / pan using fingers.
All together is kind frustrating, and I cannot focus in develop application which is my task.
Question is: Which is the right component or way to use panning (at least vertical panning / Scrolling) with touch screens and working smooth and without problems ? I thought this components should react to standard actions (like PanUp or PanDown) without need to implement the Gesture Manager and control one by one each touch on screen. I would like to receive your kind feedback. Thank You
Conclusion: Many thanks to all who have helped with their comments. My own conclusion is Delphi is not ready to be used as a RAD for touching screens. The touching implementation is poor and need too much work for very standard using. Should not be necessary invent the wheel again for a very common and standard controls. Actually there are more mobile device users, than desktop users. Perhaps Embarcadero should decide to pay attention to this matter, and give well finished tools wich meet the OS touch and feel controls.
Let me add the same in FM using TGrid works fine.

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.

How to perform 'cheap' scale of the entire screen in D2D?

I am working on a touch screen application (WinRT) and currently draw some graphics to the screen. Because it is touch, I want to enable pinch-to-zoom for scaling the entire content. For a better experience, I only want to redraw the graphics, once the pinch gesture is complete. For the intermediate scalings, I would like to reuse the current bitmap, and perform (if possible) a gpu-only scaling (enlarge bitmap).
Basically, I want to do exactly what iOS and Windows Phone have been doing for years now.
How can I implement this in Direct2D?
As a bonus, If you know a good ressource for reading on Direct2D, please tell me. The MSDN documentation is really poor and I have to hunt different blogs and magazine articles to learn :(
What I tried so far:
m_target->SetTransform(
D2D1::Matrix3x2F::Scale(
D2D1::Size(1.5f, 1.5f),
D2D1::Point2F(500.0f, 500.0f))
);
However, if I do this for interactive elements (like page zoom-in/zoom-out), all objects are rendered (which is also slow).
Another option could be to draw into a BITMAP and use that as the base for the transforms. However, I am not sure if this is a good approach.
Note: I am currently debugging on a Desktop but want to target tablets. I have to consider that tablets are orders of magnitude slower. That's why I try to optimize this functionality.
Thanks!

Visual Studio 2010 C++ console applications

I am new to C++ and I would like to know what the limitations are in graphics for a console application. For example---Could I create something as compicated as some of the
very colorful screensavers that have all kinds of splashes of color?? Could I draw lines
of changing color based on input strings??? I would appreciate any advice someone could
give me.
Thanks Doug
If you want to do some serious animation you'll pribably want hardware accelerated graphics (DirectX, OpenGL). If you just want simple images and animations a GUI app would do. As far as the console it's not really intended for more than text output but it can draw lines and change colors if you really want too.
However none of the three are limitations of C++ ... C++ as a language does not care about graphics that would be an OS limitation primarily and you'll find most of your drawing code however you go about it will be somewhat OS or hardware dependent unless you use a cross platform library with GUI or graphics support like QT, wxWidgets, OpenGL, etc.
As others have said, a console application is for text, not graphics! I don't know of any way (or reason) to do graphics in a console.
To do the kinds of things you are interested in (except maybe Windows screensavers) using Visual C++, I would recommend starting off with the SDL library. The Lazy Foo Productions website has an excellent series of game programming tutorials, and the first lesson gives you a step-by-step guide to build an app that displays stuff on the screen. It even has screenshots showing how to configure Visual Studio 2010, which is pretty important if you're new to this kind of thing.
SDL is free, cross-platform, and will let you (within your program's window):
draw pixels, lines, and rectangles in any color
draw text
draw images
make animations (by changing/redrawing the screen many times per second)
obtain keyboard input (including when keys are released)
It will also let you do 3D graphics with OpenGL, but that's another story.
You could, if you're very desperate- but certainly not platform-independently. From memory, the Windows API is quite good about letting you do a lot of crazy shit to it's console. However, it's probably better advised to get a genuine graphical API for this purpose, such as GDI, DirectX or OpenGL.
C++ does not have any standard facilities for drawing graphics in a console application. Any features (like changing the font color) will depend on your OS. I doubt you will find functions that do much more than changing the text color though. (For example, on Windows you would use system("color xx") to change the foreground and background color.)
Basically, if you want graphics you're going to have to abandon the console application and look for a graphics API.
Could I create something as compicated as some of the very colorful screensavers that have all kinds of splashes of color??
If by "splash" you mean "chunk of text", then yes. Otherwise no.
Could I draw lines of changing color based on input strings???
No, consoles are textual media.
If you want to try to do things to the console you need to use the Windows Console Functions. Standard C++ does not have any way to change console color.